Skip to content

Instantly share code, notes, and snippets.

View proton's full-sized avatar
🤍💙🤍

Peter Savichev proton

🤍💙🤍
View GitHub Profile
print "\e[2K\rProcessing #%05d #{row.to_h} " % (counter += 1)
$('a.link-title')[Math.random() * $('a.link-title').length | 0].title
function show_help()
{
echo "dump all git versions of a file to separate files"
echo
echo "usage: FILENAME";
echo
echo "e.g."
echo
echo "$ git_dump_all_versions_of_a_file.sh path/to/somefile.txt"
echo
@proton
proton / calc.rb
Created December 9, 2017 15:06
calculator
NUM_REGEX = /^-?[0-9\.]+/
def calc(expression)
expression = expression.gsub(' ', '').gsub('--', '+').gsub(/([\d\)])-([\(\d])/, '\1+-\2')
calculate(expression)
end
def extract_brackets(expression)
brackets_cnt = 0
expression.chars.each_with_index do |char, i|
https://proxy.antizapret.prostovpn.org:3143
https://proxy.antizapret.prostovpn.org:3128
https://gw2.anticenz.org:443
https://gw2.anticenz.org:8080
https://uk-167-116-1.friproxy0.eu:443 [UK]
https://ua-139-170-1.fri-gate0.biz:443 [UA]
https://fr-54-189-1.friproxy.eu:443 [FR]
https://fr-54-189-1.friproxy.eu:443 [FR]
https://es-23-210-1.fri-gate0.biz:443 [ES]
https://fr-11-87-1.fri-gate0.eu:443 [FR]
Started GET "/" for 127.0.0.1 at 2013-04-30 15:40:02 +0400
Processing by HomeController#show as HTML
Rendered home/show.html.slim within layouts/application (68.0ms)
Completed 500 Internal Server Error in 159ms
NoMethodError - undefined method `image_path' for nil:NilClass
(in /home/proton/projects/prj/app/assets/stylesheets/bootstrap_lib.css.sass):
(gem) bootstrap-sass-2.3.1.1/lib/bootstrap-sass/compass_functions.rb:5:in `image_path'
(gem) sass-3.2.8/lib/sass/script/funcall.rb:112:in `_perform'
(gem) sass-3.2.8/lib/sass/script/node.rb:40:in `perform'
#encoding utf-8
require 'vkontakte_api'
TOKEN = ''
#https://oauth.vk.com/authorize?client_id=3389744&scope=photos,offline&redirect_uri=http://oauth.vk.com/blank.html&display=page&response_type=token
vk = VkontakteApi::Client.new
#encoding utf-8
require 'vkontakte_api'
TOKEN = ''
#https://oauth.vk.com/authorize?client_id=3389744&scope=photos,offline&redirect_uri=http://oauth.vk.com/blank.html&display=page&response_type=token
vk = VkontakteApi::Client.new
def Decode(param):
#-- define variables
loc_3 = [0,0,0,0]
loc_4 = [0,0,0]
loc_2 = ''
#-- define hash parameters for decoding
dec = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
hash1 = ["L", "y", "c", "X", "2", "M", "a", "l", "p", "5", "Q", "e", "R", "t", "Z", "Y", "9", "m", "d", "0", "s", "V", "b", "3", "7", "="]
hash2 = ["i", "B", "v", "U", "H", "4", "D", "n", "k", "8", "x", "T", "u", "G", "w", "f", "N", "J", "6", "W", "1", "g", "z", "o", "I", "r"]
hash1 = ["c", "u", "4", "V", "z", "5", "k", "m", "y", "p", "L", "J", "I", "d", "0", "M", "9", "e", "3", "8", "v", "l", "i", "7", "n", "="];
>> Using rack adapter
/home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- active_support/core_ext/class/inheritable_attributes (LoadError)
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `block in require'
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require'
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/bundler/gems/active_merchant-b9eb7e1590f2/lib/active_merchant.rb:29:in `<top (required)>'
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
from /home/proton/.rvm/gems/ruby-1.9.3-p194@webra/gems/bundler-1.1.5/lib/bundler/runtime.rb:68: