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
it "requires http basic_auth" do | |
@credentials = ActionController::HttpAuthentication::Basic.encode_credentials("login", "password") | |
request.env['HTTP_AUTHORIZATION'] = @credentials | |
get 'index' | |
# specs here | |
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
$(document).ready(function() { | |
// Creates canvas 320 × 200 at 10, 50 | |
var rects = new Array(); | |
var data = [10, 20, 30, 40, 50, 60]; | |
console.log(data.length); | |
var paper = Raphael(10, 50, 640, 480); | |
var i = 0; | |
for (i = 0; i < data.length; i++) { | |
// Creates starting rects | |
var rect = paper.rect(0, i*30, 10, 25); |
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
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.10/lib/dm-core/adapters/data_objects_adapter.rb:92:in `execute_non_query': (mysql_errno=1064, sql_state=42000) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT NULL, `branch` VARCHAR(50) DEFAULT 'master', `command` VARCHAR(50) DEFAU' at line 1 (MysqlError) | |
Query: CREATE TABLE `integrity_projects` (`id` serial PRIMARY KEY, `name` VARCHAR(50), `permalink` VARCHAR(50), `uri` VARCHAR DEFAULT NULL, `branch` VARCHAR(50) DEFAULT 'master', `command` VARCHAR(50) DEFAULT 'rake', `public` TINYINT DEFAULT 1, `building` TINYINT DEFAULT 0, `created_at` DATETIME, `updated_at` DATETIME, `build_id` INT(11), `notifier_id` INT(11)) from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.10/lib/dm-core/adapters/data_objects_adapter.rb:92:in `execute' |
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
mstannard ~/c/dukejour /master $ rake dukejour:discover | |
(in /Users/mstannard/code/dukejour) | |
iTunes is not running! | |
# started iTunes | |
mstannard ~/c/dukejour /master $ rake dukejour:discover | |
(in /Users/mstannard/code/dukejour) | |
Adding library Jude?s Library | |
Done. |
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
# launch control script for nginx on osx | |
# place in /System/Library/LaunchDaemons/nginx.plist | |
# then run "launchctl load -F /System/Library/LaunchDaemons/nginx.plist" | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>nginx</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
# include this in application controller | |
module Authentication | |
protected | |
# Inclusion hook to make #current_user and #signed_in? | |
# available as ActionView helper methods. | |
def self.included(base) | |
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method | |
end | |
# Returns true or false if the user is signed in. |
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
> compass --rails . | |
> cat .gems | |
formtastic | |
compass | |
# i had haml in .gems previously and it was causing a conflict | |
> git push heroku master |
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
# Get access to a Library object by locale, always scope by Locale | |
# A library object gives us conveneince methods to access | |
# books, authors, fiction and non-fiction book code indeicies by locale. | |
# The files that drive these indices are located in blake/data/models/db/library/[product]/[subject-index].yml | |
library = BlakeDataModels::Library.new(locale: 'au', name: 'reading_eggspress') | |
# What series are available in the locale's library? | |
library.series_names # Generates array ["abc", "blake_novels", "boffin_boy", "brainwaves", ...] |
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
# ember-cli | |
# chat router | |
`import Ember from 'ember'` | |
ChatRoute = Ember.Route.extend | |
setupController: (controller, model)-> | |
@_super(controller, model) |
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
# room_channel.ex | |
defmodule Stadium.RoomChannel do | |
use Phoenix.Channel | |
def join(socket, "lobby", _) do | |
reply socket, "joined", "you joined" | |
{:ok, socket} | |
end |
OlderNewer