# 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 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
:: 1) Download srvany.exe from Microsoft Windows 2003 Resource Kit (available free from Microsoft). | |
:: 2) Copy srvany.exe into the folder where google drive is installed or next to this script file. | |
:: 3) Run this script as an Administrator | |
echo off | |
cls | |
SET STARTING_DIR=%CD% | |
SET SCRIPT_DIR=%~dp0 |
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
module ActiveAdminHelper | |
def admin_arbre_context | |
@admin_arbre_context ||= Arbre::Context.new(assigns, self) | |
end | |
def default_renderer | |
case controller.send(:resource_class).name | |
when "ActiveAdmin::Page" | |
"page" |
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
http { | |
# Declare index at http level | |
index index.html index.php; | |
server { | |
# Set IP & Port For Server Block | |
listen 00.000.000.000:80; | |
# Set Server Name | |
server_name www.example.com; | |
# Redirect WWW to non WWW (http://wiki.nginx.org/Pitfalls) |
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
<?php | |
// Make ajax requests to /wp-admin/admin-ajax.php?action=get_post&id=127 | |
add_action('wp_ajax_get_post', 'figgis_get_post_json'); | |
add_action('wp_ajax_nopriv_get_post', 'figgis_get_post_json'); | |
function get_post_json() { | |
header('Cache-Control: no-cache, must-revalidate'); | |
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600)); |
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
brew update | |
brew install gmp | |
#install Nginx | |
brew install nginx | |
# copy launch script | |
cp /usr/local/Cellar/nginx/1.0.12/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/ | |
#try to launch Nginx | |
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist |
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
# models/person.rb | |
serialize :auth_hash, Hash | |
def facebook | |
@fb_user ||= FbGraph::User.me(user_attributes[:token]) | |
end | |
def twitter | |
@tw_user ||= prepare_access_token(user_attributes[:token], user_attributes[:secret]) | |
end |
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 Class = Object.create(null, { | |
"new": { | |
"value": function () { | |
var result = Object.create(this, { | |
"class": { | |
"value": this | |
} | |
}); | |
result.initialize.apply(result, arguments); | |
return result; |
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
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/ | |
# added hackery to work around wordpress issues - Patrick Anderson ([email protected]) | |
# clearly this could be cleaner, but it does work | |
require 'rack' | |
require 'rack-legacy' | |
require 'rack-rewrite' | |
# patch Php from rack-legacy to substitute the original request so | |
# WP's redirect_canonical doesn't do an infinite redirect of / |
- Install stud
$ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
- Download and install the powssl script
$ curl https://raw.github.com/gist/2050941/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl
$ chmod +x ~/bin/powssl
- Run powssl to create development certificate and configure stud.
$ powssl