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
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Scrub sensitive parameters from your log | |
# filter_parameter_logging :password | |
before_filter :log_page_view, :except => [:destroy] | |
private |
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
client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET, | |
:authorize_url => "/o/oauth2/auth", | |
:access_token_url => "/o/oauth2/token", | |
:site => 'https://accounts.google.com/') | |
get '/auth' do | |
url = client.web_server.authorize_url( | |
:redirect_uri => redirect_uri, | |
:scope => 'https://www.googleapis.com/auth/cloudprint', | |
:response_type => "code" |
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
gem install do_postgres -- \ | |
--with-pgsql-server-dir=/Applications/Postgres.app/Contents/Versions/9.3 \ | |
--with-pgsql-server-include=/Applications/Postgres.app/Contents/Versions/9.3/include/postgresql/server |
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
#dropbox { | |
position: relative; | |
} | |
#dropbox > input { | |
position: absolute; | |
top: 0px; | |
right: 0px; | |
bottom: 0px; | |
left: 0px; |
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
// assuming you have an AudioBuffer instance called `buffer`, | |
// and an AudioContext (or OfflineAudioContext) called `ctx`... | |
// create a new Worker... | |
var worker = new Worker('recorderWorker.js'); | |
// get it started and send some config data... | |
worker.postMessage({ | |
command: 'init', |
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
# Deploying a Sinatra app to Heroku | |
## Database | |
The location of the database Heroku provides can be found in the environment | |
variable DATABASE_URL. Check the configure-block of toodeloo.rb for an example | |
on how to use this. | |
## Server | |
Heroku is serving your apps with thin, with means you have all your thin goodness available, | |
such as EventMachine. |
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 CarrierWave | |
module MiniMagick | |
def toaster_filter | |
manipulate! do |img| | |
img.modulate '150,80,100' | |
img.gamma 1.1 | |
img.contrast | |
img.contrast | |
img.contrast | |
img.contrast |
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> | |
<head> | |
<title>Codesnippit NodeJS Twitter Tracker Client</title> | |
</head> | |
<body> | |
<ul></ul> | |
<script> | |
(function() { | |
var script = document.createElement("script"); | |
script.src = "http://code.jquery.com/jquery.min.js"; |
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
// JavaScript code that finds dates for today, this weekend, this month, next month | |
// This weekend = next Sat and Sun | |
// This month = today to end of this month | |
// Next month = 1st of next month = end of next month | |
// Useful on Business Catalyst web app search form for searching from-to dates | |
// Requires jquery and moment.js | |
$(document).ready(function(){ | |
$('#today_nav').on("click", function(){ |
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
/* | |
--- | |
name: guilloche | |
script: guilloche.js | |
description: guilloche | |
provides: [Guilloche] | |
... | |
*/ |
OlderNewer