pets = %w[dog cat rabbit]
puts "My first pet is a %s, my second one a %s and my third is a %s" % pets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
Команда | Описание | |
---|---|---|
apropos | — | ищет в названиях и описаниях страниц мануала |
at | — | выполняет команды в заданное время |
atq | — | выдаёт список заданий пользователя (если он суперпользователь — все задания) |
atrm | — | удаляет задания по их номеру |
batch | — | выполняет команды, если уровни загрузки системы это позволяют |
bg | — | переводит выполнение команды в фоновый режим |
cal | — | отображает календарь |
cat | — | объединяет файлы и выводит их на стандартный поток вывода |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Usage: | |
# $ springer.sh | |
# will save all books | |
# | |
# $ springer.sh word | |
# will save all books whose titles or authors match "word" | |
# Link with books and links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'net/http' | |
require 'uri' | |
require 'rexml/document' | |
require 'date' | |
# TODO: Make city selectable, not hardcoded | |
def city | |
26063 # St Petersburg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get install mc htop git unzip wget curl -y | |
echo | |
echo "=====================================================" | |
echo " WELCOME" | |
echo "=====================================================" | |
echo | |
echo "Hub" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = \| a_{ij} \|, i = 1, \dotsc, j = 1, \dotsc, 4, | |
A_i = ( a_{i1}, a_{i2}, a_{i3}, a_{i4} ), | |
M_k = \{ m_{ik} = | a_{ik} - a_{i1} | : m_{ik} = \min_{j=2, \dotsc, 4}( |a_{ij} - a_{i1}| ), i = 1, \ldots\}, | |
P_k = \frac{ card(M_k) }{ \sum\limits_{k=2}^{4} card(M_k) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
Usage examples: | |
big_array.each_with_progress(){ |e| ... } | |
(0...1000000).each_with_progress(){ |i| ... } | |
big_hash.each_key_with_progress(){ |k| ... } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Input: Pyramid's height | |
# Output: Pyramid with given height and width = height * 2 - 1 | |
# | |
MAX_HEIGHT = 20 | |
prompt = 'Enter pyramid\'s height: ' | |
puts prompt | |
while height = gets.chomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
li $t0, 0x10010000 | |
addiu $t1, $t0, 0x100 | |
li $t2, 0 | |
li $t3, 1 | |
Square: | |
sw $t2, ($t0) | |
addiu $t0, $t0, 4 | |
add $t2, $t2, $t3 | |
addiu $t3, $t3, 2 | |
bne $t0, $t1, Square |
OlderNewer