Skip to content

Instantly share code, notes, and snippets.

View kennym's full-sized avatar

Kenny Meyer kennym

View GitHub Profile
@EtienneDepaulis
EtienneDepaulis / active_admin.css.scss
Created November 14, 2012 08:18
jQuery Datatables + Active Admin
@import "dataTables/jquery.dataTables";
/* A modifier pour avoir les bons espacements */
body.active_admin .data_table {
padding-bottom: 10px;
}
body.active_admin .dataTables_paginate {
margin-top: -10px;
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@FGRibreau
FGRibreau / .gitignore
Created July 18, 2012 12:29
Find if a NodeJS module is available to require or not
node_modules
@sbusso
sbusso / grape_goliath
Created July 14, 2012 14:34
REST API: rails_api + thin vs grape + goliath vs sinatra + thin vs grape + thin
Request rate: 178.3 req/s (5.6 ms/req)
Request size [B]: 78.0
Reply rate [replies/s]: min 178.0 avg 178.0 max 178.0 stddev 0.0 (1 samples)
Reply time [ms]: response 5.6 transfer 0.0
Reply size [B]: header 126.0 content 167.0 footer 0.0 (total 293.0)
Reply status: 1xx=0 2xx=1000 3xx=0 4xx=0 5xx=0
CPU time [s]: user 0.92 system 4.66 (user 16.4% system 83.1% total 99.6%)
Net I/O: 64.6 KB/s (0.5*10^6 bps)
@palexander
palexander / gist:2975305
Last active January 21, 2022 14:03
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
#
# An improvement on http://stackoverflow.com/a/9094206/284612
#
# Place this file in spec/support/signed_cookies.rb
#
module SignedCookies
def signed_cookie(name, opts={})
verifier = ActiveSupport::MessageVerifier.new(request.env["action_dispatch.secret_token".freeze])
if opts[:value]
@request.cookies[name] = verifier.generate(opts[:value])
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@widged
widged / gist:1915768
Created February 26, 2012 09:56
How to reuse content with Sencha Touch - stackoverflow question
/*
Code for question on stackoverflow - http://stackoverflow.com/questions/9432309/how-to-reuse-content-with-sencha-touch
Expanding on a SenchaFiddle contributed by rdougan.
*/
Ext.Loader.setConfig({ enabled: true });
var topStore = Ext.create('Ext.data.Store', {
//give the store some fields
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bxt
bxt / csv-export.sh
Created September 13, 2011 20:58
Exporting whole MySQL databse to CSV files
#!/bin/bash
# USAGE: Will create a .tar.gz with CSVs of all tables in schema.
# Configure below and run as root (i.e. the user mysql runs as)
#
# The script will (or should) SELECT * INTO OUTFILE your tables
# and save them into csv files under /tmp dir first, then name them
# like the tables and move them thogether into a directory. Then
# it will tar everything together and chown you the tarball.
# Schema to export: