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
// Testing Helper which I use to log a user in. | |
// This blows up before 'student logged in' is logged | |
var loginStudent = function(username, password) { | |
visit('/').click('.studentsLogin .btn span') | |
.fillIn('#email-field', username) | |
.fillIn('#password-field', password) | |
.click('#login-button').then(function() { | |
console.log("Student logged 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
{ | |
teachers:[ | |
{ | |
id:"6504b6d64d61743f7c000000", | |
type:"Teacher" | |
} | |
], | |
students:[ | |
{ | |
id:"2905b6d64d61743f7c030000", |
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 seems my request is fine when its not wrapped in a closure, | |
// but blows up with CORS errors when inside... | |
// The following works fine with no issues | |
var videoUrl = "http://vimeo.com/api/v2/video/75738368.json?callback=?" | |
$.getJSON(videoUrl, function (data) { | |
console.log("Data: ", data) | |
}); | |
Hist.VideoHandler = function() { |
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
// The following method only returns the public static variables of the View class | |
// when called like so: | |
// Class klass = android.view.View.class; | |
// parser.getAllFieldsForClass(klass); | |
public Field[] getAllFieldsForClass(Class klass) { | |
Field[] fields = klass.getDeclaredFields(); | |
if (fields.length == 0) { | |
return new Field[0]; | |
} else { |
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 byId(id) { | |
return document.getElementById(id); | |
} | |
function vote(node) { | |
var v = node.id.split(/_/); // {'up', '123'} | |
var item = v[1]; | |
// hide arrows | |
byId('up_' + item).style.visibility = 'hidden'; |
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 initialize | |
puts "--Initializing Message Monitor" | |
EM.run { | |
puts "before Faye::Websocket::Client.new()" | |
ws = Faye::WebSocket::Client.new("wss://somewebsocket.com:/ms/monitor") | |
puts "After Faye::Websocket::Client.new()" | |
ws.onopen do |event| | |
puts "WebSocket Opened!" | |
ws.send('Hello, world!') |
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/bin/env ruby | |
# vid-utility | |
shows_folder = "/media/Gowie-Internal/Shared/TV-Shows/" | |
show_titles = %x(ls #{shows_folder}).split(/\r?\n/) | |
files = %x(ls) | |
files.each_line do |filename| |
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() { | |
define(['backbone', 'models/movie'], function(backbone, Movie, dtvCollection) { | |
return window.Movies = window.DTVCollection.extend({ | |
model: Movie, | |
url: function() { | |
return this.urlRoot() + 'movies.json'; | |
}, | |
parse: function(response) { | |
console.log(response); |
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
# This is in my .bash_aliases: | |
alias flw="source ~/Programs/flw.sh" | |
# ~/Programs/flw.sh | |
#!/bin/bash | |
# Follow Script written by Matt Gowie | |
if [[ $2 && ${2-x} && $3 && ${3-x} ]]; then |
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 show | |
if @app_navigation == "TabBar" | |
first_screen = TapwalkLink.new(@app_config.menu_items[0]) | |
redirect_to url_for(:controller => first_screen.controller, first_screen.link_params) | |
end | |
end |