Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block advorak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:632657
params[:id] = 1
Artist.where("lastname LIKE '(?)*'",params[:id])
# This generates the following query:
# SELECT "artists".* FROM "artists" WHERE (lastname LIKE '('a')*')
# Note how you don't want the apostrophe within your "where" query ...
Artist.where("lastname LIKE ?",params[:id])
View gist:833794
View about_scoring_project.rb
#!/usr/bin/env ruby
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used calculate the
# score of a single roll of the dice.
# A greed roll is scored as follows:
# * A set of three ones is 1000 points
# * A set of three numbers (other than ones) is worth 100 times the
View gist:1171959
pingServerTimer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(pingServer:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:pingServerTimer forMode:NSRunLoopCommonModes];
View gist:1193237
$(document).ready(function() {
$('a.pastEvents').click(function() {
var html = '';
$.getJSON('/events/past_events.json', {}, function(data) {
$(data).each(function(entryIndex, entry) {
html += 'andy';
advorak /
Created Nov 29, 2011 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script (adds an application icon)
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
appify v3.0.0 for Mac OS X -
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"`
advorak / home.css.scss
Created May 21, 2012 — forked from anonymous/home_controller.rb
Calendar for the current month
View home.css.scss
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here:
#monthName {
text-align: center;
position: absolute;
top: 0;
display: inline;
a {
text-decoration: none;
View Calendar.cfm
<table border="1" width="100%" height="100%">
<cfloop index="x" from="1" to="7">
<cfset firstOfTheMonth = createDate(year(now()), month(now()), 1)>
View haml nested table
%td This is cell 0,0
%td This is cell 0,1
%td{colspan: 2}
%td This is a cell on its own in a table all its own.
advorak / ERROR
Last active Dec 10, 2015 — forked from RemiBa/ERROR
NoMethodError in OrderitemsController#create
undefined method `stringify_keys' for #<Order:0x2c630a0>
Application Trace | Framework Trace | Full Trace
app/controllers/orderitems_controller.rb:11:in `create'
You can’t perform that action at this time.