Skip to content

Instantly share code, notes, and snippets.

View charlie-wasp's full-sized avatar

Timur Ramazanov charlie-wasp

  • ezil.me
  • Saint-Petersburg, Russia
View GitHub Profile
@charlie-wasp
charlie-wasp / obfuscated_id.rb
Created August 15, 2018 15:00
Obfuscated ID generator
module ObfuscatedId
extend ActiveSupport::Concern
# Constants used to obfuscate identifiers with formula id * multipier % modulo
# modulo and multiplier must be coprime numbers to avoid collisions
# modulo must be larger than maximum value of id
MODULO = Rails.application.secrets.id_obfuscation[:modulo]
EXPONENT = Rails.application.secrets.id_obfuscation[:exponent]
# Should contain digits and letters common for latin and cyrillic alphabets
# "12345679AEKMHPCTYX".split('').shuffle.join

Keybase proof

I hereby claim:

  • I am charlie-wasp on github.
  • I am charlie_wasp (https://keybase.io/charlie_wasp) on keybase.
  • I have a public key ASDITkQGEvumrpuLf6ZzLbik6aseXN3hUYKEepGGjAamPQo

To claim this, I am signing this object:

Boot Error
Something went wrong while loading /app/config.ru
JSON::ParserError: 743: unexpected token at 'Cannot GET /webpack_manifest.json '
/app/vendor/bundle/ruby/2.3.0/gems/json-2.0.3/lib/json/common.rb:156:in `parse'
/app/vendor/bundle/ruby/2.3.0/gems/json-2.0.3/lib/json/common.rb:156:in `parse'
/app/vendor/cache/hanami-webpack-1019f8efc217/lib/hanami_webpack/manifest.rb:38:in `remote_manifest'
/app/vendor/cache/hanami-webpack-1019f8efc217/lib/hanami_webpack/manifest.rb:56:in `manifest'
@charlie-wasp
charlie-wasp / .vimrc
Created February 21, 2016 12:34
My main .vimrc file
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-surround'
Plugin 'kchmck/vim-coffee-script'
@charlie-wasp
charlie-wasp / ssh-tunnel.sh
Last active September 14, 2015 04:47
Open SSH tunnel bash command
#ssh -L <local_machine_port>:<remote_machine_ip>:<remote_machine_port> -p <remote_machine_ssh_port> -l <remote_machine_ssh_user> -N <remote_machine_ip>
#Example
ssh -L 5555:100.100.100.100:80 -p 22 -l root -N 100.100.100.100
# Now go to localhost:5555 and you'll see 192.168.108.52:80 actually