Skip to content

Instantly share code, notes, and snippets.

View formigarafa's full-sized avatar

Rafael Santos formigarafa

View GitHub Profile
test:
adapter: mysql2
database: my_app_test
username: root
encoding: utf8
cucumber:
adapter: mysql2
database: my_app_test
username: root
encoding: utf8
@tenderlove
tenderlove / mt_complete.rb
Last active December 11, 2020 19:56
tab completion for minitest tests
#!/usr/bin/env ruby --disable-gems
# Tab completion for minitest tests.
#
# INSTALLATION:
#
# 1. Put this file in a directory in your $PATH. Make sure it's executable
# 2. Run this:
#
# $ complete -o bashdefault -f -C /path/to/this/file.rb ruby
@joefiorini
joefiorini / Brocfile.js
Created June 12, 2014 01:42
My setup for building an Angular.js app with Broccoli & grunt
var ngMin = require('broccoli-ng-min');
var uglify = require('broccoli-uglify-js');
var compileSass = require('broccoli-ruby-sass');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var findBowerTrees = require('broccoli-bower');
var env = require('broccoli-env').getEnv();
var compileES6 = require('broccoli-es6-concatenator');
var app = 'app/scripts';
@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@coryvirok
coryvirok / gist:9478263
Last active September 6, 2016 12:07
Rollbar javascript notifier. Ignore uncaught errors that are *not* from www.mycompany.com.
function ignoreRemoteUncaught(isUncaught, args, payload) {
try {
var filename = payload.data.body.trace.frames[0].filename;
if (isUncaught && !filename.match(/^https?:\/\/www\.mycompany\.com/)) {
// Ignore uncaught errors that are not from www.mycompany.com.
return true;
}
} catch (e) {
// Most likely there was no filename or the frame doesn't exist.
}
@banaslee
banaslee / XGH - en.txt
Last active May 3, 2024 14:47
eXtreme Go-Horse Process
eXtreme Go Horse (XGH) Process
Source: http://gohorseprocess.wordpress.com
1. I think therefore it's not XGH.
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster.
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the wrong one but faster.
XGH is faster than any development process you know (see Axiom 14).
@mildmojo
mildmojo / left_join_arel_example.rb
Last active April 5, 2024 16:00
LEFT JOIN in ARel for ActiveRecord in Ruby on Rails
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of
# the mechanics, not a real-world use case.
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord
# extension that works for any named association. That's what I really wanted!
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446
# == DEFINITIONS
# - A Taxi is a car for hire. A taxi has_many :passengers.
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi.
@chrismeyersfsu
chrismeyersfsu / gist:3270358
Created August 6, 2012 04:22
Arduino Poor man's oscilloscope
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
sudo ifconfig en1 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
@bryanveloso
bryanveloso / brew-services.rb
Created December 8, 2011 09:39 — forked from lwe/brew-services.rb
External script for homebrew to simplify starting services via launchctl, out of the box support for any formula which implements #startup_plist. (This version fixes the deprecation warning raised on Formula.resolve_alias.)
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>