In Bash and also for other implementations of the shell, like zsh and fish, you can use the HereDoc to redirect a multi-line or block of lin
seen from United States

seen from Germany
seen from China
seen from Germany
seen from Greece
seen from China
seen from United States
seen from Lithuania
seen from India
seen from China

seen from T1

seen from United States
seen from T1
seen from Yemen
seen from United States
seen from United Arab Emirates
seen from United Kingdom

seen from Latvia
seen from China
seen from Türkiye
In Bash and also for other implementations of the shell, like zsh and fish, you can use the HereDoc to redirect a multi-line or block of lin

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
PHP 8.2 預計要將一些字串內指定變數的方法標為 Deprecated,在 9.0 移除
PHP 8.2 預計要將一些字串內指定變數的方法標為 Deprecated,在 9.0 移除
Twitter 上看到這個蠻大的改變: New #PHP Implemented PHP 8.2 RFC: Deprecate ${} string interpolation https://t.co/KDop21MTiV — PHP RFC Bot (@PHPRFCBot) May 5, 2022 裡面的連結是「PHP RFC: Deprecate ${} string interpolation」,在文件中提到了 PHP 語言支援的四種字串內指定變數的方式: Directly embedding variables (“$foo”) Braces outside the variable (“{$foo}”) Braces after the dollar sign (“${foo}”) Variable variables (“${expr}”, equivalent to…
View On WordPress
使用 heredoc 語法的 Dockerfile
使用 heredoc 語法的 Dockerfile
在 Simon Willison 這邊看到的,在 Dockerfile 裡面使用 heredoc 語法編 Docker image:「Introduction to heredocs in Dockerfiles」,引用的文章是「Introduction to heredocs in Dockerfiles」與「Introduction to heredocs in Dockerfiles」,七月的事情了。 heredoc 指的是可以讓開發者很方便使用多行結構,在 Dockerfile 這邊常見到的 pattern: RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y ... 但這樣會產生出很多層 image,所以先前的 best practice 是: RUN apt-get update &&…
View On WordPress
Cómo escribir comentarios en bash correctamente
Cómo escribir comentarios en bash correctamente. Cuando desarrollamos scripts Bash, tenemos que seguir unas reglas de buenas practicas. El código debe ser limpio y comprensible, organizado por bloques, sangrados y con nombres descriptivos de las variables y funciones. Otra forma de mejorar el código es con el uso de comentarios. El comentario es una pequeña anotación legible para humanos, donde se explica paso a paso las operaciones a realizar por el script bash. Esta practica recomendable te ahorrará tiempo y trabajo cuando pasado un tiempo revises de nuevo el código. Por ejemplo, si quieres modificar un script creado hace meses, lo más probable es que no recuerdes por qué escribiste el código de esa manera. Con un comentario lo entenderás enseguida. Los comentarios también ayudan a otros programadores o sysadmin, que quieran modificar o continuar con tu trabajo. Los comentarios deben ser cortos y directos, no son necesarias las explicaciones obvias ni medias tintas. En este artículo vemos los conceptos básicos de escritura, para que tus scripts bash tengan unos comentarios eficientes.
Cómo escribir comentarios en bash
Lo primero que debes recordar es, que Bash ignora (no ejecuta) todo lo escrito en una línea después de un hash "#" (también conocido como almohadilla). Como única excepción a hash, indicamos cuando en la primera línea del script se inserta algo similar a lo siguiente. #!/bin/bash Esto obligará al sistema a usar el intérprete de comandos que nosotros queremos, en el resto del código. Los comentarios se pueden insertar antes de cada línea o en la misma línea, vemos los dos ejemplos. # Recopilar los valores VAR1 y VAR2 read -r -p "Introduce el primer valor: " VAR1 read -r -p "Ahora el valor a comparar: " VAR2 # o read -r -p "Introduce el primer valor: " VAR1 # Recopilar valor VAR1 read -r -p "Ahora el valor a comparar: " VAR2 # Recopilar valor VAR2 Si observas los ejemplos anteriores te darás cuenta que después de los hash dejamos un espacio. Realmente no es necesario, pero es evidente que aumenta su legibilidad de manera considerable. Otra utilidad interesante de los comentarios es, que con el hash (#) puedes anular la ejecución de cualquier línea. Es una buena práctica si estas probando scripts, o agregas otras funciones que no siempre son necesarias. Vemos un ejemplo. # Recopilar los valores VAR1 y VAR2 (VAR3 opcional) read -r -p "Introduce el primer valor: " VAR1 read -r -p "Ahora el valor a comparar: " VAR2 #read -r -p "Compara el resultado con otro valor: " VAR3 La inmensa mayoría de lenguajes de programación admiten comentarios multilínea, por su estructura de construcción lectora bash no los admite. Debes insertarlos linea por linea. # Recopilar el valor VAR1 # Recopilar el valor VAR2 read -r -p "Introduce el primer valor: " VAR1 read -r -p "Ahora el valor a comparar: " VAR2 Si no te convence el sistema multilínea, puedes usar HereDoc que es un tipo de redirección que nos permite pasar múltiples líneas de entrada a un comando. Si HereDoc no redirige a ningún comando, lo podemos aprovechar como marcador posicional de comentarios multilínea (hablaremos de HereDoc en un próximo articulo). Read the full article
a/A - w3d2
Today we reviewed how ruby can integrate with SQL. We were tasked today with building our own database, which I enjoyed coming up with creative inputs. Our database consisted of Users (fname, lname), Questions (title, body, author_id), Replies (title, body, author_id, parent_id, question_id), Question Likes (question_id, user_id) and Question Followers (question_id, user_id).
We used these tables and built Classes in Ruby to translate the data to be used as ruby objects. We did not do anything in particular with the data in Ruby other than use SQL to filter the data we desired. I really did enjoy working on this and improving my knowledge of SQL. It was interesting to see how we could use data from SQL and Ruby together. I believe ActiveRecord is more commonly used with Ruby but I think it was good to learn SQL with Ruby to get familiar with databases.
I wasn’t able to get through all of the exercises today, but did the majority of them. I’ll be sure to redo all of this again come study time for the assessment! Tomorrow we begin Rails! Pretty nuts how quickly we move onto a new subject. I wish we could spend more time with SQL... I guess I’ll have to continue that on my own later on whenever I have time. Day 12 is done!

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Is it possible to object-select a heredoc or “here document” with vim?
Is it possible to object-select a heredoc or “here document” with vim?
One of Vim’s great strengths is object-select, offering quick manipulation of content inside words, paragraphs and assorted delimiters.
For example,
vi{
will select everything inside a pair of {} braces.
Is there any equivalent functionality for selecting a here document or heredoc:
<<<HTML .... .... HTML;
Based on ErichBSchulz’s answer I came up with the following for an heredoc…
View On WordPress
Answer: How do you escape characters in heredoc? #development #programming #solution
Answer: How do you escape characters in heredoc? #development #programming #solution
How do you escape characters in heredoc?
I’m working with a bash script trying to stop it from attempting to replace variables inside my heredoc. How do set a heredoc to either A) escape the variable names instead of parsing them or B) return the entire string untouched?
cat > /etc/nginx/sites-available/default_php <<END server { listen 80 default; server_name _; root /var/www/$host; <- $host is…
View On WordPress
Answer: How can I write a here doc to a file in Bash script? #solution #answer #programming
Answer: How can I write a here doc to a file in Bash script? #solution #answer #programming
How can I write a here doc to a file in Bash script?
How can I write a here document to a file in Bash script?
Answer [by Aif]: How can I write a here doc to a file in Bash script?
#!/bin/bash wall <<stuffhere hello everybody, reboot in 5 minutes stuffhere
should do the work. Otherwize, you can consider using a temporary file using > >> and < operators.
Answer [by Joshua Enfield]: How can I…
View On WordPress