Skip to content

Instantly share code, notes, and snippets.

View full-of-foo's full-sized avatar
💭
I'm currently working 150% of the time as a manager. No code 👎

Toeknee full-of-foo

💭
I'm currently working 150% of the time as a manager. No code 👎
View GitHub Profile
@chrisbloom7
chrisbloom7 / excercise_custom_factory_girl_steps.feature
Created December 23, 2011 09:16 — forked from blaix/factory_girl_steps.rb
A modified version of the cucumber steps included in factory_girl, which will set an instance variable based on the factory/factories being generated. Drop this file into the features/support folder and don't require the original factory_girl/step_definit
# Assumes you have a factory named :customer defined with attributes first_name and last_name
Feature: Testing customized factory_girl step definitions
As an open source advocate
I
Want to make sure that my customized step definitions don't throw any errors
Scenario: Generating factories from a table
Given the following customers exist:
| first_name | last_name |
| Bob | Smith |
@dav
dav / gist:3738695
Created September 17, 2012 17:40
Script to copy photos/videos into iPhone Simulator
require 'etc'
require 'fileutils'
# Copies the most recent MAX_IMAGES photos/videos from the device image dir.
# I use Dropbox to sync my device images to my workstation disk
MAX_IMAGES=500
USER_HOME_DIR = Etc::getpwuid.dir
DEVICE_IMAGES_DIR="#{USER_HOME_DIR}/Dropbox/Camera Uploads"
SIMULATOR_IMAGES_DIR="#{USER_HOME_DIR}/Library/Application Support/iPhone Simulator/5.1/Media/DCIM/100APPLE"
@ryanlanciaux
ryanlanciaux / Food.js
Created June 5, 2013 03:33
Files for AngularJS blog post.
/*---------------------
:: Food
-> model
---------------------*/
module.exports = {
attributes : {
name: 'STRING',
type: 'STRING',
expiration: 'DATE',
quantity: 'STRING',
@ankbul
ankbul / howto-filemerge-git-osx.md
Created May 14, 2012 19:16 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@iMilnb
iMilnb / ec2.py
Created May 27, 2015 12:29
AWS EC2 simple manipulation script using python and boto3
#!/usr/bin/env python
# Simple [boto3](https://github.com/boto/boto3) based EC2 manipulation tool
#
# To start an instance, create a yaml file with the following format:
#
# frankfurt:
# - subnet-azb:
# - type: t2.micro
# image: image-tagname
@fparaggio
fparaggio / rails.history.js
Created December 16, 2011 13:47 — forked from nragaz/rails.history.js
Add callbacks to remote links in Rails to manage browser history using pageState and replaceState
function historySupport() {
return !!(window.history && window.history.pushState !== undefined);
}
function pushPageState(state, title, href) {
if (historySupport()) {
history.pushState(state, title, href);
}
}
@johnrees
johnrees / _ubuntu_steps.sh
Last active November 29, 2021 01:42
Standard Rails 5.* setup for Ubuntu 14.04 LTS
# As root user
sudo su
# Update the OS
sudo apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc
source ~/.bashrc
# rubocop version 0.52.1
# bundle exec rubocop -a -D -S
# disable all cops example
# rubocop:disable all
# rubocop:enable all
AllCops:
Include:
- Rakefile
@andrius
andrius / Procfile
Last active July 22, 2022 22:00
How to dockerize #rails app with #puma. Edit config/application.rb and config/puma.rb #docker #ruby
api: bundle exec puma -C config/puma.rb
@milyoni
milyoni / LICENSE
Created June 24, 2011 20:50
heroku autotag deploy scripts
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEA