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
var http = require('http') | |
http.createServer(function (req,res) { | |
res.writeHead(200, {'Content-Type':'text/plain'}); | |
res.end('Hello World! \n'); | |
}).listen(1337,"127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337//'); |
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
$.fn.modalize = function(){ | |
$(this).each(function(i,v){ // Iterate over each of the elements | |
var el = $(v), popup = el.prev('.popup'); | |
el.bind('input', function(){ // When the user types within input... | |
if(popup.is(':hidden')) el.prev('.popup').fadeIn(100); // Grab previous sibling with class of 'popup' | |
}); | |
el.bind('focusout', function(){ // When focus leaves this element... | |
$('.popup').fadeOut(300); // Fade all popups out | |
}); | |
}) |
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
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/1333785) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p0 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
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
keyDown: (event) -> | |
switch event.keyCode | |
# Backspace | |
when 8 | |
if @el.val() is '' | |
token = @tokens.pop() | |
token.remove() | |
# Enter | |
when 13 then Houston.nextStep() if @el.autocomplete 'option', 'disabled' | |
# @ |
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
$(function(){ | |
REGEX = /^\/thefrontiergroup\//; | |
if(window.location.pathname.match(REGEX)){ | |
var actions, tip, button, commentForm, comment; | |
discussion = $('#discussion_bucket'); | |
actions = discussion.find('div.form-actions'); |
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
.border-container { | |
width: 28%; /* border will be on the left on this container */ | |
float: right; | |
overflow: hidden; /* only needed if floating container */ | |
min-height: 600px; /* static height if you want your container to be taller than its content */ | |
-moz-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
-webkit-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF; | |
border-width: 0 0 0 1px; | |
-webkit-border-image: |
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
class Diablo3 | |
def self.pick_my_class(option1,option2) | |
options = [] | |
18.times do | |
options.push(option1) | |
options.push(option2) | |
end | |
options.push('QUIT LIFE') | |
options.shuffle! | |
# puts options.sample |
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
var _cli = require('commander'), | |
_glob = require('glob'), | |
_minimatch = require('minimatch'), | |
_wrench = require('wrench'), | |
_fs = require('fs'), | |
_path = require('path'), | |
_requirejs = require('requirejs'); | |
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
def page_classes | |
classes = [] | |
# Get our path along with action name | |
path = controller.controller_path.split('/') << controller.action_name | |
# Add appropriate class based on namespace | |
if path[0] != 'admin' | |
classes << 'public' | |
end | |
# Add class based on whether or not sidebar content is provided | |
if content_for?(:sidebar) || content_for?(:contextual_sidebar_nav) |