Skip to content

Instantly share code, notes, and snippets.

View bk322's full-sized avatar

Boris Kheyfets bk322

View GitHub Profile
@ataylor284
ataylor284 / http2.groovy
Last active May 29, 2022 12:11
A mininimalist http2 server with jetty
/*
* Jetty with HTTP2 enabled
* Instructions:
* 1. Create keystore with `keytool -keystore http2_keystore.jks -storepass password -noprompt -genkey -keyalg RSA -keypass password -alias jetty \
* -dname CN=localhost,OU=dev,O=sonatype,L=home,ST=cloud,C=US -ext SAN=DNS:localhost,IP:127.0.0.1 -ext BC=ca:true`
* 2. Run with: `groovy http2.groovy`
* 3. Confirm http2 is being used with `curl -v --http2 --insecure https://localhost:8443`
*/
@Grapes([
@MaxLevs
MaxLevs / cvimCyMap
Last active March 25, 2018 15:25
cvim Cyrillic mapping
let langmap = "ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>"
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active August 27, 2024 20:09
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@shimizukawa
shimizukawa / conf.py
Last active January 2, 2016 11:59
Sphinx extension to render local toctree in templates (ex. sidebar). see also: https://groups.google.com/d/msg/sphinx-users/d0dwJ4YiMhs/PjHqUVozriIJ
sys.path.insert(0, os.path.abspath('.'))
extensions = ['localtoc']
html_sidebars = {'somepage': ['localtoc.html']}
@mislav
mislav / gist:938183
Created April 23, 2011 02:28
Faraday SSL example
connection = Faraday::Connection.new('http://example.com') do |builder|
builder.request :url_encoded # for POST/PUT params
builder.adapter :net_http
end
# same as above, short form:
connection = Faraday.new 'http://example.com'
# GET
connection.get '/posts'