Skip to content

Instantly share code, notes, and snippets.

View magnum's full-sized avatar
💭
experimenting...

Antonio Molinari magnum

💭
experimenting...
View GitHub Profile
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@sammyrulez
sammyrulez / create_django_gondor_project.sh
Created August 31, 2011 09:09
script to create a django project bound to gondor.io deploy
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Error in $0 - Invalid Argument Count"
echo "Syntax: $0 project_name gondor_app_id"
exit
fi

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@kenzie
kenzie / .profile
Created June 6, 2012 13:14
Start MongoDB and Redis daemons from the command line (OS X)
# add these aliases to your BASH profile ~/.profile
alias mongodb-start="mongod run --config /usr/local/etc/mongod.conf"
alias redis-start="redis-server /usr/local/etc/redis.conf"
# TODO add stop commands
@sandropaganotti-zz
sandropaganotti-zz / Rakefile
Created October 28, 2012 14:49
Selectively exports wordpress tables replacing required string tokens also in serialized fields.
# more info and usage here:
# http://sandropaganotti.com/2012/10/28/migrating-a-single-site-of-a-wordpress-multisite-instance/
require 'yaml'
require 'ostruct'
require 'mysql2'
require 'php_serialize'
namespace :util do
@RobertAudi
RobertAudi / Install imagemagick
Created July 15, 2013 17:42
Automatically Create Icons for iOS Apps. Full credits to Yuya Kitajima (aka @yuyak on Github) for this rake task, shared as a Coderwall tip. https://coderwall.com/p/otmx2g
brew install imagemagick
@magnum
magnum / gist:6163775
Last active December 20, 2015 16:48
concatenate filters and and ordering
@categories = Categories.page params[:page]
@categories = @categories.order(params[:order_field] => params[:order_direction) unless params[:order_field].blank? || params[:order_direction].blank?
@categories = @categories.where(:attr1 => params[:p1]) unless params[:p1].blank? # (n times)
@xpmatteo
xpmatteo / gist:8317762
Last active December 1, 2017 10:05
Solution of the FizzBuzz problem in an OCP dojo
describe('fizz buzz',function(){
var self = this;
beforeEach(function(){
var threeChecker = new Checker(3, "Fizz");
var fiveChecker = new Checker(5, "Buzz");
var sevenChecker = new Checker(7, "Bang");
self.fizzBuzzer = new FizzBuzzer([threeChecker, fiveChecker, sevenChecker]);
});
it('Default is say the number',function(){
@arnaudbreton
arnaudbreton / async-process-jasmine.Spec.js
Last active August 29, 2015 14:00
The 5 best front-end developer tools blogpost: testing with Mocha and Jasmine
AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
});
it('should process 42', function() {
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();