Skip to content

Instantly share code, notes, and snippets.

View 0xqd's full-sized avatar
🚀
Buidl web3

jn 0xqd

🚀
Buidl web3
View GitHub Profile
@0xqd
0xqd / omniauth.rb
Created August 26, 2012 06:13 — forked from dira/omniauth.rb
OmniAuth strategy for a custom provider
# config/initializers/omniauth.rb
module OmniAuth
module Strategies
# tell OmniAuth to load our strategy
autoload :Pixelation, 'lib/pixelation_strategy'
end
end
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, "app_name", "secret"
@0xqd
0xqd / example.rb
Created August 26, 2012 13:50 — forked from henrik/example.rb
Simple memoize method for Ruby now that ActiveSupport::Memoizable is deprecated. Memoizes per argument set, handles falsy values.
def my_method(foo, bar)
memoize(:my_method, foo, bar) do
foo * bar
end
end
@0xqd
0xqd / ruby-memoization.rb
Created August 26, 2012 19:20 — forked from rfelix/gist:79500
Ruby Self-Modification Example - Memoize
require 'benchmark'
class Fib
def fib(n)
return n if n < 2
return fib(n-1) + fib(n-2)
end
end
def memoize(className, methodName)
@0xqd
0xqd / package.json
Created August 30, 2012 13:53 — forked from gquental/package.json
Nodejs - Package.json
{
"name": "app-name",
"version": "0.1.0",
"author": "nXqd",
"description": "app-description",
"dependencies": {
"request": "*",
"connect": "*"
},
"engines": {
@0xqd
0xqd / _html5boilerplate.css.sass
Created August 31, 2012 08:30 — forked from richardvenneman/_html5boilerplate.css.sass
HTML5 Boilerplate HAML & SASS
/*
* HTML5 ✰ Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*
* Detailed information about this CSS: h5bp.com/css
*
* ==|== normalize ==========================================================
@0xqd
0xqd / dabblet.css
Created September 4, 2012 06:50 — forked from vasilisvg/dabblet.css
Standard html5 form
/**
* Resultaat oefening 2.2b HTML5 forms
*/
label {
display: block
}
:invalid {
background: #ffdddd;

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar xvfz redis-2.4.8.tar.gz 
$ cd redis-2.4.8/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis
===========================================================
PATHS
===========================================================
# Make sure /usr/local/bin is at top
sudo nano /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
@0xqd
0xqd / cap.rb
Created September 4, 2013 08:59 — forked from kix/cap.rb
http://www.dizzy.co.uk/cheatsheets
This work is licensed under the Creative Commons
Attribution-NonCommercial-NoDerivs 2.0 License. To
view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-nd/2.0/uk
########## Shell Commands ##########
Installation:
$ gem install capistrano
@0xqd
0xqd / .editorconfig
Last active December 23, 2015 11:29 — forked from josephj/.editorconfig
root = true
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = double
spaces_around_operators = true
space_after_control_statements = true