Skip to content

Instantly share code, notes, and snippets.

View cheshire137's full-sized avatar

Sarah Vessels cheshire137

View GitHub Profile
@gaurav
gaurav / gist:41182
Created December 29, 2008 05:03
A quick command to list all the files modified by an author in a repository
git log --name-status --pretty=format:'' --author=authorname | sort | uniq
@msabramo
msabramo / git_prompt_info.zsh
Created April 11, 2012 00:07
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@mildmojo
mildmojo / left_join_arel_example.rb
Last active April 5, 2024 16:00
LEFT JOIN in ARel for ActiveRecord in Ruby on Rails
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of
# the mechanics, not a real-world use case.
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord
# extension that works for any named association. That's what I really wanted!
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446
# == DEFINITIONS
# - A Taxi is a car for hire. A taxi has_many :passengers.
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi.
@mildmojo
mildmojo / active_record_left_join.rb
Created November 16, 2012 22:27
Adding #left_joins to ActiveRecord::Base
# Adds left joins to ActiveRecord.
#
# = Description
#
# This patch adds a #left_joins method to ActiveRecord models and relations. It
# works like #joins, but performs a LEFT JOIN instead of an INNER JOIN.
#
# = A warning about +count+
#
# When using with #count, ActiveRecord 3.2.8 is hard-coded to act as if
@seyhunak
seyhunak / seeds.rb
Created December 7, 2013 14:54
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
// Random Heart
// random hearts for you
int number = 128;
float x;
float y;
float a;
// http://www.colourlovers.com/palette/1099931/be_my_valentine
color[] palette = { color(247,162,185), color(242,100,122), color(221,38,32), color(146,2,0) };

EDIT: Since this original post, the BikeShed has become a separate entity completely separate from GitHub and any other sponsors. The charter is to continue to provide community support and involvement in technology wherever and whenever we can.

This just also happens to be a co-working space. 😄

In October of 2013, the Nashville team was told that the building where we occupied a co-working space had been sold. Since that time, we have been working to find ourselves a new home. The upside/downside is that Nashville has exploded over the last 3 years, and this effort turned out to be much harder than expected. But, the time has come where we have finally 🚢ed our new space, and we'd love to have you over and see!

Our new office location is at 530 Church St, Suite 400a, Nashville, TN, 37219. 530_church_street__nashville__tn_-_google_search

@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

# Autogenerated input type of AddComment
input AddCommentInput {
# A unique identifier for the client performing the mutation.
clientMutationId: String
# The Node ID of the subject to modify.
subjectId: ID!
# The contents of the comment.
body: String!