Skip to content

Instantly share code, notes, and snippets.

View RStankov's full-sized avatar
🤖
👨‍💻

Radoslav Stankov RStankov

🤖
👨‍💻
View GitHub Profile
@ngauthier
ngauthier / live
Created February 3, 2012 15:38
Do it live!
#/usr/bin/env sh
clear
$*
while inotifywait -qr -e close_write *; do clear; $*; done
@averyvery
averyvery / Guardfile
Created July 3, 2012 21:06
Retina images with Guard
guard 'process', :name => 'shrink-images', :command => 'ruby resize-mobile-images.rb mobileretina' do
watch /^images\/mobileretina\/.+/
end
@AndrewRadev
AndrewRadev / ginitpull.vim
Last active March 9, 2016 22:58
Start a github pull request from Vim
" Usage:
"
" :Ginitpull [remote-name] [branch-name]
"
" Initiates a github pull request in the default browser, from the given
" branch name to master, on the given remote. Tab-completes both arguments.
"
" If called without any arguments, defaults to the "origin" remote and the
" current branch name, which is probably what you usually want.
"
@dchelimsky
dchelimsky / output.txt
Created March 16, 2012 15:28
RSpec is not the reason your rails test suite is slow
[david: compare]$ # at this point we have a stock rails app with no minitest tests and one pending rspec example
[david: compare]$
[david: compare]$ time rake test
Run options:
# Running tests:
Finished tests in 0.030419s, 0.0000 tests/s, 0.0000 assertions/s.
@ivosabev
ivosabev / Example.js
Created March 8, 2017 09:24
Basic react-intl setup
import React from 'react';
import {withIntl} from 'ufleet-intl';
const Example = (props) => <div>{props.t('Hello, {name}', {name: 'React'})}</div>;
export default withIntl(Example);
@tsuhachev
tsuhachev / gist:1745360
Created February 5, 2012 12:48 — forked from gkop/gist:1371962
Capture javascript errors in Cucumber+Capybara+Webdriver tests
# in features/support/env.rb
require 'selenium/webdriver'
# we need a firefox extension to start intercepting javascript errors before the page
# scripts load
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
# see https://github.com/mguillem/JSErrorCollector
profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi")
Capybara::Selenium::Driver.new app, :profile => profile
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@jimweirich
jimweirich / abstract.md
Created April 17, 2012 23:53
Berlin Clock Kata

Berlin Clock

Original Reference

Create a representation of the Berlin Clock for a given time (hh::mm:ss).

The Berlin Uhr (Clock) is a rather strange way to show the time. On the top of the clock there is a yellow lamp that blinks on/off every two seconds. The time is calculated by adding rectangular lamps.

@AndrewRadev
AndrewRadev / diffsplit.vim
Last active May 22, 2018 14:45
Split a git diff in separate files to mirror the original repo layout
" Put this in plugin/diffsplit.vim.
"
" Executing :Diffsplit on a file, containing a git diff would open up a new
" tab, cd to a temporary directory, and distribute the changes into separate
" files, mirroring the repo layout. You can then use NERDTree or whatever you
" like to browse through the changes.
"
" Using it straight from the command-line is fairly simple and aliasable:
"
" git diff whatever | vim - -R +Diffsplit
@mislav
mislav / _notes.md
Created July 21, 2010 18:25
"livereload" server replacement for working with Rails

A replacement for "livereload" gem on OS X

This script is a replacement for livereload server component designed for working with Rails. It watches the filesystem with FS Events (Mac OS X) rather than with EventMachine. This is better for large projects for wich EventMachine fails with "too many open files" exception.

Sass is supported; .sass files can also be stored in "app/styles/" directory. Compass is detected if "config/compass.rb" file exists.

Installation:

Download this script to somewhere in your PATH and make it executable. You can name it something different than "livereload" if you want to try this and the official gem executable in parallel.