Skip to content

Instantly share code, notes, and snippets.

View knorrium's full-sized avatar

Felipe Knorr Kuhn knorrium

View GitHub Profile
@fhwang
fhwang / gist:1887192
Created February 22, 2012 20:55
Rake tasks for running spec files that match a pattern. Developed for the good folks at HowAboutWe.
namespace :spec do
namespace :units do
desc "Run unit specs with PATTERN in the spec file name"
RSpec::Core::RakeTask.new(:selective => "db:test:prepare") do |t|
t.pattern = FileList["spec/**/*#{ENV['PATTERN']}*_spec.rb"].exclude("spec/integration/**/*_spec.rb")
end
end
namespace :integration do
desc "Run integration specs with PATTERN in the spec file name"
@fnichol
fnichol / README.md
Created February 26, 2012 01:23
A Common .ruby-version File For Ruby Projects

A Common .ruby-version File For Ruby Projects

Background

I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

@firedfox
firedfox / onDOMContentLoaded.js
Created April 24, 2012 02:12
phantomjs onDOMContentLoaded
const PHANTOM_FUNCTION_PREFIX = '/* PHANTOM_FUNCTION */';
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
if (msg.indexOf(PHANTOM_FUNCTION_PREFIX) === 0) {
eval('(' + msg + ')()');
} else {
console.log(msg);
}
@dblock
dblock / failures_formatter.rb
Created May 4, 2012 19:52
RSpec tests broken up into suites with retry.
# inspired by https://github.com/rspec/rspec-core/pull/596
require 'rspec/core/formatters/base_formatter'
module RSpec
module Core
module Formatters
class FailuresFormatter < BaseFormatter
def dump_failures
return if failed_examples.empty?
@irae
irae / .jslintrc
Created May 21, 2012 19:22
my jslintrc
{
/*** Globals ***/
// To ignore any custom global variables, enable the `predef` option and list
// your variables within it.
"predef": [
"exports",
"YUITest",
"YUI",
"YUI_config",
"YAHOO",
@natritmeyer
natritmeyer / Usage.txt
Last active January 16, 2017 01:56
JUnit formatter for RSpec
NOTE: I've created a gem based on this: https://github.com/natritmeyer/yarjuf
---------
rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml
@zspencer
zspencer / bootstrap.sh
Created May 30, 2012 02:04
Bootstrapping like a boss
#symlink gcc to a non-llvm version installed xCode's CLI tools
if [ -f /usr/bin/gcc-4.2 ]; then
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
sudo rm /usr/bin/cc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/cc
fi
@markrickert
markrickert / giratchive.sh
Created June 12, 2012 20:20
Git Archive Bash Script
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
@Blackshawk
Blackshawk / blog - Explaining My Choices Further.md
Last active April 25, 2023 19:31
In which I do a little digging about the choices I've made with PHP. This is a long read, but it isn't something that can be explained in one or two paragraphs.

In the comments from my last post and on Twitter I noticed a lot of people who had something to say about PHP. The comments were varied but they usally sounded something like this (sorry @ipetepete, I picked yours because it was the shortest).

...the little bits of soul from all of us who've had to work on, and or maintain large PHP applications. – ipetepete

In Pete's defense, he did go on to say that rest of the stack I was using was a "smorgasbord of awesome". Thanks, Pete. I agree!

I would, however, like to take a little time to correct a misperception in the developer community about PHP. I recently got into this same... discussion... with Jeff Atwood, and I seem to be running into it more and more. So here goes. Please bear with me as I cover a little history further on.

Pete, and everybody else, _you're exactly rig

@matsuda
matsuda / 1_install_openssl
Last active December 14, 2019 03:14
install Ruby 2.0 with Homebrew
$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl
==> Caveats
To install updated CA certs from Mozilla.org: