Skip to content

Instantly share code, notes, and snippets.

View Wendersonandes's full-sized avatar

Wenderson Fernandes Wendersonandes

  • Emerge
  • Belo Horizonte, Brazil
View GitHub Profile
#recursively require all files in directory (and subdirectories)
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each {|file| require file }
#recursively require all files in directory but skip paths that match a pattern
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each do |file|
require file unless file =~ /\/model\//
end
@rheaton
rheaton / tracker_csv_export_to_pdf.rb
Created March 30, 2011 15:38
takes a csv file from tracker and makes story cards. be careful of the order when you are cutting them up.
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@squiter
squiter / vhosts.php
Created May 26, 2011 19:46
Script para automatização da criação dos Virtual Hosts usados nos servidores de desenvolvimento da Equipe Abstraindo
<?php
/*
* Title: vhost.php
* Create_date: 2011.02.23
* Author: Abstraindo Team
* Version: 0.1
* Desc: Script para auto inserção de virtual host do Apache,
* adição de regra no arquivo host e envio de e-mail para os
* interessados.
* HowToUse: execute sudo php vhost.php $endereçoVhost $pathProject
@oferreiro
oferreiro / custom_plupload.js
Created August 2, 2011 13:53
plupload custom example
//= require plupload/plupload
//= require plupload/plupload.html4
//= require plupload/plupload.html5
$(function(){
var atoken = $("input[name=authenticity_token]").val();
var uploader = new plupload.Uploader({
runtimes : 'html5',
browse_button : 'pickfiles',
container : 'uploader',
@justinko
justinko / gist:1179343
Created August 29, 2011 20:34
Run a rake task in a separate process in your Rails app
desc 'Execute a task in the background'
task :background, :task do |t, args|
rake_path = `which rake`.chomp
app_path = Dir.pwd
cmd = "#{rake_path} #{args.task} --trace --rakefile #{app_path}/Rakefile >> #{app_path}/log/rake.log 2>&1 &"
puts 'Executing:'
puts " #{cmd}"
system cmd
end
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu
@benbalter
benbalter / wp-db.tutorial.php
Created January 13, 2012 18:41
WordPress DB Tutorial
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;
@founddrama
founddrama / moment-in-node.js
Created March 24, 2012 12:53
Moment.js examples
// node:
var moment = require('moment');
moment().add('days', 2).fromNow();
// 'in 2 days'
moment().subtract('days', 2).fromNow();
// '2 days ago'
moment('November 1977').fromNow()
@evansolomon
evansolomon / gist:2274120
Created April 1, 2012 09:36
nginx WordPress multisite config
server {
listen 80 default_server;
server_name domain.com *.domain.com;
root /srv/www/domain.com/public;
access_log /srv/www/domain.com/log/access.log;
error_log /srv/www/domain.com/log/error.log;
location / {
index index.php;
@utsengar
utsengar / Sync_Async_loading_handlebars.js
Created April 2, 2012 20:41
synchronous and asynchronous loading of handlebars templates
/*
* This decorates Handlebars.js with the ability to load
* templates from an external source, with light caching.
*
* To render a template, pass a closure that will receive the
* template as a function parameter, eg,
* T.render('templateName', function(t) {
* $('#somediv').html( t() );
* });
* Source: https://github.com/wycats/handlebars.js/issues/82