This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place all the styles related to the home controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
#monthName { | |
text-align: center; | |
position: absolute; | |
top: 0; | |
display: inline; | |
a { | |
text-decoration: none; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
appify v3.0.0 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('a.pastEvents').click(function() { | |
$('ul#pastEvents').empty(); | |
var html = ''; | |
$.getJSON('/events/past_events.json', {}, function(data) { | |
$(data).each(function(entryIndex, entry) { | |
html += 'andy'; | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pingServerTimer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(pingServer:) userInfo:nil repeats:YES]; | |
[[NSRunLoop currentRunLoop] addTimer:pingServerTimer forMode:NSRunLoopCommonModes]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[myxml] | |
<item> | |
<title>Book1</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> | |
</item> | |
<item> | |
<title>Book2</title> | |
<author>Bob</author> | |
<link>http://url1.com</link> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
NewerOlder