Skip to content

Instantly share code, notes, and snippets.

View abepetrillo's full-sized avatar
🏠
Working from home

Abraham Petrillo abepetrillo

🏠
Working from home
View GitHub Profile
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@abepetrillo
abepetrillo / instance_of_matcher.js
Created November 20, 2012 17:33
Jasmine matcher
beforeEach(function(){
this.addMatchers({
toBeInstanceOf: function (expected) {return this.actual instanceof expected;}
});
});
@abepetrillo
abepetrillo / global_vars
Created May 8, 2013 08:58
chrome dev tools snippet
var defaults = ["top",
"window",
"location",
"external",
"chrome",
"Intl",
"v8Intl",
"document",
"attr",
"webkitNotifications",
@abepetrillo
abepetrillo / gist:5643554
Created May 24, 2013 13:36
Example grunt config
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "test@example.com",
:from => "test@example.com",
:subject => "Test") do |format|
format.text
@abepetrillo
abepetrillo / ruby_upgrade
Created September 4, 2014 09:14
Upgrade ruby from 1.9.3-p545 to 2.1..2(p95) using rbenv
Get the latest `ruby-build` from `brew`:
```bash
brew upgrade ruby-build --HEAD
```
Make sure 2.1.2 is available in the list:
```bash
rbenv install --list
@abepetrillo
abepetrillo / podify-components-ember.js
Last active April 6, 2016 22:23
Move old components to the new pod structure encouraged by ember-cli
var fs = require('fs'),
path = require('path');
function walkSync(currentDirPath, callback) {
fs.readdirSync(currentDirPath).forEach(function (name) {
var filePath = path.join(currentDirPath, name);
var stat = fs.statSync(filePath);
if (stat.isFile()) {
callback(filePath, stat);
} else if (stat.isDirectory()) {
{
interaction(id: "#{id}") {
...
}
}
module GraphApi
QueryType = GraphQL::ObjectType.define do
name "Query"
description "The query root of this schema"
field :interaction do
type InteractionType
argument :id, !types.ID, "This is the ID of the interaction"
argument :some_obscure_thing, "Quick explanation what this is"
resolve -> (obj, args, ctx) do