This file contains 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
<%= link_to 'Notify Yourself', | |
'#', | |
onclick: "uceem.fade('#notification_prompt', '#{ j render(partial: 'notify_yourself_form').html_safe }');", | |
class: 'btn btn-primary btn-large' %> | |
<%= link_to 'Notify Another User', | |
'#', | |
onclick: "uceem.fade('#notification_prompt', '#{ j render(partial: 'notify_another_user_form').html_safe }');", | |
class: 'btn btn-primary btn-large' %> |
This file contains 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
module ArrayDataStruct | |
ACADEMIC_TLDS = [ | |
'ac.ae', | |
'ac.at', | |
'ac.bd', | |
'ac.be', | |
'ac.cr', | |
'ac.cy', | |
'ac.fj', |
This file contains 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
import re; import sys | |
from collections import defaultdict | |
try: | |
file = open(sys.argv[1]) | |
except: | |
print "Usage: python wf.py <path_to_file/filename>" | |
word_freq = defaultdict(int) | |
for line in file: |
This file contains 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
require 'feedzirra' | |
feed = Feedzirra::Feed.fetch_and_parse('http://feeds.feedburner.com/TechCrunch/') | |
puts feed.title | |
puts feed.url | |
puts feed.feed_url | |
puts feed.etag | |
puts feed.last_modified |
This file contains 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
device["signal_strength"] == nil ? '0' : device["signal_strength"] | |
# You can also can use the following: | |
device['signal_strength'] || 0 |
This file contains 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
// From http://stackoverflow.com/questions/3680429/click-through-a-div-to-underlying-elements/4839672#4839672 | |
$('.duck_ie').click(function(e) { | |
var left = $(window).scrollLeft(); | |
var top = $(window).scrollTop(); | |
//hide the overlay for now so the document can find the underlying elements | |
$(this).css('display','none'); | |
//use the current scroll position to deduct from the click position |
This file contains 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
$ -> | |
devise.grabUserEmailToSendAsParam() | |
devise = | |
grabUserEmailToSendAsParam: -> | |
$('.grab-email').on('click', -> | |
if $('#user_email').val().length | |
$(this).attr('href', $(this).attr('href') + "?email=#{ $('#user_email').val() }") ) |
This file contains 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
john-bigmac~/my_gems/cradlepoint>master:% gem push cradlepoint-0.2.1.gem | |
Pushing gem to https://rubygems.org... | |
<html> | |
<head><title>500 Internal Server Error</title></head> | |
<body bgcolor="white"> | |
<center><h1>500 Internal Server Error</h1></center> | |
<hr><center>nginx</center> | |
</body> | |
</html> |
This file contains 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/sh | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
\curl -L https://get.rvm.io | bash -s stable | |
brew install openssl | |
rvm install 2.0.0 | |
rvm use 2.0.0 | |
gem install bundler |
This file contains 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
<div class="masonry" data-masonry-element="widget" data-masonry-gutter=20> | |
<!-- ... --> | |
</div> |