Skip to content

Instantly share code, notes, and snippets.

View AlexandrBasan's full-sized avatar
:octocat:
Building an effective team which works from home full-time

Alexandr Basan AlexandrBasan

:octocat:
Building an effective team which works from home full-time
View GitHub Profile
@AlexandrBasan
AlexandrBasan / 0_reuse_code.js
Created January 27, 2016 20:14
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
@AlexandrBasan
AlexandrBasan / controller.rb
Last active June 26, 2022 08:05 — forked from joakimk/controller.rb
A way to lazy load partials in Rails 4
class Controller
include LazyLoad
def show
@model = Model.find(...)
respond_to do |format|
format.html do
@html_specific_data = Model.find(...)
end
@AlexandrBasan
AlexandrBasan / ruby_csr_example.rb
Last active December 19, 2016 21:12 — forked from mitfik/ruby_csr_example.rb
Ruby example of CSR with openssl
require 'openssl'
def create_fingerprint(string)
key = OpenSSL::PKey::RSA.new 2048
self.create_fingerprint(OpenSSL::Digest::SHA256.new(key.to_pem).to_s)
string.scan(/../).map{ |s| s.upcase }.join(":")
end
def gen_key(name)
key = OpenSSL::PKey::RSA.new 1048