Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Olszowka colszowka

View GitHub Profile
@ericboehs
ericboehs / wpa_passphrase.rb
Last active May 29, 2017 20:28
Generating a WPA PSK hex key in Ruby
View wpa_passphrase.rb
require 'openssl'
ssid = 'Delorean'
passphrase = 'hoverboardsdonotworkonwater'
puts OpenSSL::PKCS5.pbkdf2_hmac_sha1(passphrase, ssid, 4096, 32).unpack("H*").first
@XVilka
XVilka / TrueColour.md
Last active January 5, 2023 16:44
True Colour (16 million colours) support in various terminal applications and terminals
View TrueColour.md

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active January 11, 2023 14:23
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@bradleypriest
bradleypriest / konami.js
Last active December 17, 2015 00:29
Ember.KonamiCode
View konami.js
Ember.KonamiCode = Ember.Mixin.create({
konami: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13],
currentIndex: 0,
keyPress: function(event) {
this._super(event);
var index = this.get('currentIndex');
if (event.keyCode === this.konami[index]) {
if (index === 10) {
this.success();
} else {
@dstrctrng
dstrctrng / gist:5315149
Last active December 15, 2015 19:59
Running a docker with runsvdir, ssh in, then destroy it
View gist:5315149
function d {
did=$(docker run -d precise runsvdir /etc/service)
ip=$(docker inspect $did | grep IpAddress | cut -d'"' -f4)
nc -z $ip 22 && ssh -oStrictHostKeyChecking=no root@$ip
docker kill $did
}
@funny-falcon
funny-falcon / changes.md
Last active May 27, 2021 05:26
Performace patch for ruby-1.9.3-p327
View changes.md

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

View selector.rb
Capybara.add_selector :record do
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) }
match { |record| record.is_a?(ActiveRecord::Base) }
end
@datenimperator
datenimperator / Gemfile
Created September 7, 2012 18:55
Sinatra, sprockets, compass, bootstrap-sass playing together
View Gemfile
source :rubygems
gem 'shotgun', :group=>:development
gem 'rack-cache'
gem 'sinatra', :require => 'sinatra/base'
gem 'sinatra-support'
gem 'haml'
@mbleigh
mbleigh / matchers.rb
Created September 7, 2012 16:53
RSpec matcher for JSON responses.
View matchers.rb
RSpec::Matchers.define :have_json_key do |expected_key|
match do |response|
@body = MultiJson.load(response.body)
result = @body.key?(expected_key.to_s)
result &&= @body[expected_key.to_s] == @expected_val if @val_provided
result
end
chain :with_value do |val|