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
money() { | |
node <<EOF | |
const http = require('http'); | |
const url = 'http://data.fixer.io/api/latest?access_key=API_KEY'; | |
http.get(url, (res) => { | |
res.setEncoding('utf8'); | |
let body = ''; | |
res.on('data', (data) => { | |
body += data; | |
}); |
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
encrypt() { | |
echo -n "$1" | openssl enc -e -aes-256-cbc -a -salt | |
} | |
decrypt (){ | |
echo "$1" | openssl enc -e -aes-256-cbc -a -d -salt | |
} |
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
money() { | |
to=${3:-rub} | |
from=${2:-usd} | |
count=${1:-1} | |
wget -qO- "http://www.google.com/finance/converter?a=$count&from=$from&to=$to" | sed '/res/!d;s/<[^>]*>//g'; | |
} | |
alias m='money' |
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
money() { | |
to=${3:-rub} | |
from=${2:-usd} | |
count=${1:-1} | |
wget -qO- "http://www.google.com/finance/converter?a=$count&from=$from&to=$to" | sed '/res/!d;s/<[^>]*>//g'; | |
} | |
alias m='money' |
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/bash | |
mysql -u user -e 'DROP DATABASE IF EXISTS db_dev; CREATE DATABASE db_dev;' | |
ssh hlts -C -o CompressionLevel=9 'mysqldump -udeploy --password=password \ | |
--skip-lock-tables \ | |
crm | gzip -9 -c' | gunzip | mysql -u root db_dev |
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 | |
hosts=( "$@" ) | |
total_hosts=${#hosts[@]} | |
while : | |
do | |
l_hosts=( ${hosts[@]} ) | |
for i in ${!l_hosts[@]} | |
do |
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
# Usage | |
# $ source /dev/stdin < <(curl url.this.bashrc) | |
PS1=$'\[\033]0;\u:${PWD##*/}\007\]' | |
PS1+=$'\[\e[0;32m\]\u\[\e[m\]\[\e[0;32m\]@\H\[\e[m\] \[\e[0;30;42m\] [home +\j] \[\e[m\]' | |
PS1+=$'\n\[\e[0;34m\]\w\[\e[m\] \[\e[0;32m\]\xe2\x98\x85\[\e[m\] \[\e[0;37m\] ' |
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
let RVRE = /^(.*?[аеиоуыэюя])(.*)$/; | |
let PERFECTIVEGROUND_1 = /(ив|ивши|ившись|ыв|ывши|ывшись)$/; | |
let PERFECTIVEGROUND_2 = /([ая])(в|вши|вшись)$/; | |
let REFLEXIVE = /(с[яь])$/; | |
let ADJECTIVE =/(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$/; | |
let PARTICIPLE_1 = /(ивш|ывш|ующ)$/; | |
let PARTICIPLE_2 = /([ая])(ем|нн|вш|ющ|щ)$/; | |
let VERB_1 = /(ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)$/; | |
let VERB_2 = /([ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)$/; | |
let NOUN = /(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$/; |
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
var bind_logging = (function(strategies, loggers) { | |
var log_always = '#bind_logging' == document.location.hash; | |
var canWeLogThis = function(eventflow) { | |
return _.every(['on', 'off', 'trigger'], function(n){ return eventflow && _.isFunction(eventflow[n]) }); | |
}, | |
canWeLogHere = function() { | |
return _.every(['groupCollapsed', 'groupEnd', 'log', 'trace'], function(n){ return console && _.isFunction(console[n]) }); | |
}, | |
getLogger = function(ctx, args) { | |
for(var i = 0; i < strategies.length; i++) { |
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
class HomeController < ApplicationController | |
def contacts | |
UserMailer.notify_email( params[:text]).deliver | |
end | |
end |
NewerOlder