Skip to content

Instantly share code, notes, and snippets.

@rshiva
rshiva / encrypt_decrypt.rb
Created November 2, 2020 05:11 — forked from 0sc/encrypt_decrypt.rb
Simple encrypt decrypt strings in ruby
require 'openssl'
def encrypt_string(str)
cipher_salt1 = 'some-random-salt-'
cipher_salt2 = 'another-random-salt-'
cipher = OpenSSL::Cipher.new('AES-128-ECB').encrypt
cipher.key = OpenSSL::PKCS5.pbkdf2_hmac_sha1(cipher_salt1, cipher_salt2, 20_000, cipher.key_len)
encrypted = cipher.update(str) + cipher.final
encrypted.unpack('H*')[0].upcase
end
@rshiva
rshiva / ladder.md
Created June 13, 2020 19:35 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@rshiva
rshiva / System Design.md
Created April 21, 2019 16:41 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rshiva
rshiva / 0-startup-overview.md
Created January 14, 2019 06:54 — forked from dideler/0-startup-overview.md
Startup Engineering notes

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb
@rshiva
rshiva / 0_reuse_code.js
Created January 27, 2014 07:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rshiva
rshiva / pgessays.py
Created November 18, 2012 18:18 — forked from olasitarska/pgessays.py
Builds epub book out of Paul Graham's essays.
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <[email protected]>
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"""
import re, ez_epub, urllib2, genshi