Skip to content

Instantly share code, notes, and snippets.

View colszowka's full-sized 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
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 October 29, 2024 09:43
True Colour (16 million colours) support in various terminal applications and terminals

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 November 2, 2024 06:45
Steps to install a Comodo PositiveSSL certificate with Nginx.

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
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
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 August 15, 2024 15:13
Performace patch for ruby-1.9.3-p327

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.

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
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.
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|