Skip to content

Instantly share code, notes, and snippets.

View masak2009's full-sized avatar

Martin Rychlovsky masak2009

View GitHub Profile
@steveh80
steveh80 / grid.scss
Last active April 16, 2020 10:32
Bootstrap viewport detection in Javascript
// needed for viewport size detection in javascript
body::before {
display: none;
content: "xs";
}
@media (min-width: $screen-sm-min) {
body::before {
content: "sm";
}
@wteuber
wteuber / encrypt_decrypt.rb
Last active May 10, 2024 12:04
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end