Skip to content

Instantly share code, notes, and snippets.

View matthijsgroen's full-sized avatar
🚀
Computering

Matthijs Groen matthijsgroen

🚀
Computering
View GitHub Profile
@matthijsgroen
matthijsgroen / rails-backbone.rb
Created July 12, 2012 04:38 — forked from rrooding/rails-backbone.rb
Rails Backbone template
gem_group :assets do
gem 'haml_coffee_assets'
gem 'execjs'
gem 'i18n-js'
end
gem_group :assets, :development do
gem 'rails-backbone'
end
gem 'haml-rails'
gem_group :test, :development do
@matthijsgroen
matthijsgroen / jnk.rb
Created May 4, 2012 09:13
Jenkins command line
#!/usr/bin/ruby
require 'net/http'
require 'net/https'
require 'base64'
require 'uri'
require 'yaml'
require 'cgi'
module Configuration
def config_file
@matthijsgroen
matthijsgroen / rails-backbone.rb
Created May 2, 2012 07:30
Rails Backbone template
gem_group :assets do
gem 'haml_coffee_assets'
end
gem_group :assets, :development do
gem 'rails-backbone'
end
gem 'haml-rails'
gem 'draper'
gem_group :test, :development do
gem 'konacha'
@matthijsgroen
matthijsgroen / .tmux.conf
Created March 15, 2012 12:32 — forked from eval/.tmux.conf
TMux config
## keybindings
unbind C-b
unbind C-a
unbind %
unbind ,
unbind .
unbind n
unbind p
unbind [
unbind '"'
@matthijsgroen
matthijsgroen / fapi
Created February 29, 2012 14:52
Fapi
#!/usr/bin/ruby
require 'net/http'
require 'net/https'
require 'base64'
require 'uri'
require 'yaml'
require 'cgi'
class Net::HTTP
alias_method :old_initialize, :initialize
@matthijsgroen
matthijsgroen / application.js.coffee
Created February 14, 2012 21:35
Backbone.contextmanager
window.App =
Models: {}
Collections: {}
Routers: {}
Views: {}
DebugInstances: {}
context_manager: null
init: ->
@context_manager = new App.Views.ContextManager
@matthijsgroen
matthijsgroen / gist:1558986
Created January 4, 2012 07:38
Convert javascript to coffeescript (ideal for jasmine specs)
" convert javascript to coffeescript
command! ConvertJs :call ConvertJs()
function! ConvertJs()
:norm =G
:silent :%s/;$//e
:silent :%s/var //ge
:silent :g/^\s\+})$/d
:silent :%s/function() {/->/ge
@matthijsgroen
matthijsgroen / jasmine.yml
Created November 29, 2011 10:35
Rails 3.1 Jasmine testing
# src_files
#
# Return an array of filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
@matthijsgroen
matthijsgroen / wrapper.rb
Created October 27, 2011 10:28
Wraps text. using Transformation Priority Premise
def find_positions_for_split(text, width)
if space = text[0..width].rindex(" ")
[space-1, space+1]
else
[width-1, width]
end
end
def wrap(text, width)
@matthijsgroen
matthijsgroen / prepare.rake
Created July 8, 2011 11:51
Rake file for executing guard to prepare your environment
desc "compiles all coffeescripts and scss stylesheets in the project"
task :prepare => 'prepare:all'.to_sym
namespace :prepare do
desc "compiles all coffeescripts in the project"
task :coffeescript do
run_guards "Guard::CoffeeScript"
end