Skip to content

Instantly share code, notes, and snippets.

View ilyazub's full-sized avatar
🇺🇦

ilyazub

🇺🇦
View GitHub Profile
@chriseppstein
chriseppstein / _icons.scss
Created December 5, 2010 21:48
This is an example of the generated stylesheet by compass for a set of sprites
@import "compass/utilities/sprites/base";
// General Sprite Defaults
// You can override them before you import this file.
$icon-sprite-base-class: ".icon-sprite" !default;
$icon-sprite-dimensions: false !default;
$icon-position: 0% !default;
$icon-spacing: 0 !default;
$icon-repeat: no-repeat !default;
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011 23:18
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@phollyer
phollyer / spreadsheet_test
Created September 13, 2011 17:43
Spreadsheet Gem - updating an existing sheet without changing the output location or filename
#!/usr/bin/env ruby
require 'spreadsheet'
# Begin Test
print "Spreadsheet Test\n"
# Create the rows to be inserted
row_1 = ['A1', 'B1']
row_2 = ['A2', 'B2']
@n8foo
n8foo / curl_stats.sh
Created March 1, 2012 16:40
Curl Stats Command
#! /bin/bash
curl -L --output /dev/null --write-out "http_code:%{http_code} http_connect:%{http_connect} time_total:%{time_total} time_namelookup:%{time_namelookup} time_connect:%{time_connect} time_appconnect:%{time_appconnect} time_pretransfer:%{time_pretransfer} time_redirect:%{time_redirect} time_starttransfer:%{time_starttransfer} size_download:%{size_download} size_upload:%{size_upload} size_header:%{size_header} size_request:%{size_request} speed_download:%{speed_download} speed_upload:%{speed_upload} content_type:%{content_type} num_connects:%{num_connects} num_redirects:%{num_redirects}\n" --silent $1
@trongthanh
trongthanh / gist:2779392
Last active April 17, 2024 12:12
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@adamawolf
adamawolf / geojson_us.js
Created September 3, 2012 23:15
GeoJSON Multipolygon for the United States
{
"type": "MultiPolygon",
"coordinates":
[
[
[
[ -123.123779, 48.227039 ], // contig. u.s.
[ -123.318787, 49.000042 ],
[ -121.742592, 49.000267 ],
[ -95.157394, 49.000493 ],
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

diff --git a/lib/rspec/core/example_group.rb b/lib/rspec/core/example_group.rb
index 6b167d0..56afa77 100644
--- a/lib/rspec/core/example_group.rb
+++ b/lib/rspec/core/example_group.rb
@@ -309,9 +309,12 @@ module RSpec
# @private
def self.run_before_all_hooks(example_group_instance)
return if descendant_filtered_examples.empty?
- assign_before_all_ivars(superclass.before_all_ivars, example_group_instance)
- run_hook(:before, :all, example_group_instance)