# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
ar http = require('http'); | |
var fs = require('fs'); | |
var util = require('util'); | |
var fileCache; | |
var sendFile = function(conn, file) { | |
conn.writeHead(200, {"Content-Type": "text/html", "Content-Length": file.length}); | |
conn.write(file); | |
conn.end(); | |
} |
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
var mongoose = require('mongoose'); | |
mongoose.connect('localhost', 'testing_multiTenant'); | |
/** | |
* User schema. | |
*/ | |
var UserSchema = new mongoose.Schema({ | |
name: String | |
, prefix: { type: String, required: true } |
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
## If you are using under a rails project, | |
## I recommend to put this script onto config/initializer instead of applying the patch | |
module Compass::SassExtensions::Functions::GradientSupport | |
class ColorStop < Sass::Script::Literal | |
def initialize(color, stop = nil) | |
self.options = {} | |
if color.is_a?(Sass::Script::String) && color.value == 'transparent' |
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
begin | |
require 'aws/s3' | |
rescue LoadError => e | |
e.message << " (You may need to install the aws-s3 gem)" | |
raise e | |
end | |
class SitemapS3Publisher | |
def generate | |
sitemap.create |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
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 Paperclip | |
class << self | |
def logger #:nodoc: | |
MongoMapper.logger | |
end | |
end | |
module ClassMethods | |
def has_attached_file name, options = {} | |
include InstanceMethods |
Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.
- All jquery plugins should be prefixed with jquery, such as
jquery.facebox
- All github-specific jquery plugins should be prefixed with jquery.github. Like
jquery.github.repo_list.js
- All page-specific files (that only run on ONE page) should be prefixed with page.
page.billing.js
NewerOlder