Skip to content

Instantly share code, notes, and snippets.

View strong-code's full-sized avatar

Colin strong-code

  • California
View GitHub Profile
Ỏ̷͖͈̞̩͎̻̫̫̜͉̠̫͕̭̭̫̫̹̗̹͈̼̠̖͍͚̥͈̮̼͕̠̤̯̻̥̬̗̼̳̤̳̬̪̹͚̞̼̠͕̼̠̦͚̫͔̯̹͉͉̘͎͕̼̣̝͙̱̟̹̩̟̳̦̭͉̮̖̭̣̣̞̙̗̜̺̭̻̥͚͙̝̦̲̱͉͖͉̰̦͎̫̣̼͎͍̠̮͓̹̹͉̤̰̗̙͕͇͔̱͕̭͈̳̗̭͔̘̖̺̮̜̠͖̘͓̳͕̟̠̱̫̤͓͔̘̰̲͙͍͇̙͎̣̼̗̖͙̯͉̠̟͈͍͕̪͓̝̩̦̖̹̼̠̘̮͚̟͉̺̜͍͓̯̳̱̻͕̣̳͉̻̭̭̱͍̪̩̭̺͕̺̼̥̪͖̦̟͎̻̰Ỏ̷͖͈̞̩͎̻̫̫̜͉�
INF/util:procutil 90870 [*] Forking "/Users/chl/.nvm/versions/node/v6.1.0/lib/node_modules/stf/lib/cli.js migrate"
INF/db 90872 [*] Connecting to 127.0.0.1:28015
INF/db:setup 90872 [*] Database "stf" already exists
INF/db:setup 90872 [*] Table "users" already exists
INF/db:setup 90872 [*] Table "accessTokens" already exists
INF/db:setup 90872 [*] Table "vncauth" already exists
INF/db:setup 90872 [*] Table "devices" already exists
INF/db:setup 90872 [*] Table "logs" already exists
INF/db:setup 90872 [*] Index "devices"."owner" already exists
INF/db:setup 90872 [*] Waiting for index "devices"."owner"
app.get('/verify', function(req, res) {
var username = "test@test.com";
var pass = "test123";
// Here I want to return the result of verify(username, pass) in the response back to the client
})
var verify = function (username, pass) {
module Pirata
class Torrent
def initialize(params)
@url = params[:url]
end
end
end
require 'nokogiri'
require 'open-uri'
/home/action/.gem/ruby/1.9.1/gems/pirata-0.0.1/lib/pirata/torrent.rb:8:in `block in initialize': undefined method `url=' for #<Pirata::Torrent:0x000000010dbcd0> (NoMethodError)
from /home/action/.gem/ruby/1.9.1/gems/pirata-0.0.1/lib/pirata/torrent.rb:8:in `each'
from /home/action/.gem/ruby/1.9.1/gems/pirata-0.0.1/lib/pirata/torrent.rb:8:in `initialize'
from api.rb:61:in `new'
from api.rb:61:in `block in collect_results'
from /home/action/.gem/ruby/1.9.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:237:in `
require 'nokogiri'
require 'open-uri'
require 'collection'
require 'torrent'
module Pirata
class API
attr_reader :base_url
#
# A sorting algorithm that leverages the "green" threads of Ruby's Thread
# class. It uses a timer to count down from all positive integer elements
# of the supplied array, and passes them to a sorted array once the timer
# has expired. Since in theory integers of the same value can have their
# timers finish at the same time or at arbitrarily different times (in
# terms of which finishes first), this sorting is not considered stable.
#
# In theory, this algorithm runs in O(n*t) time where n is the number of
# elements in the supplied array and t is the unit of time used for the
var Photo = function(options){
this.attributes = options;
_.extend(this.attributes, options);
}
Photo.prototype.get = function(attrName){
return this.attributes[attrName];
}
@strong-code
strong-code / String Formatting
Created August 22, 2013 04:56
JS String Formatting function
/*C# style string formatting function
var greet = String.format("Hello, {0}", name);
*/
String.format = function() {
var s = arguments[0];
for (var i = 0; i < arguments.length - 1; i++) {
var reg = new RegExp("\\{" + i + "\\}", "gm");
@strong-code
strong-code / oly training
Created February 5, 2013 01:46
oly training programming
Snatch - 2x/week (1 heavy sn, 1 technique (80%))
CNJ-2x/week, 1 clean complex variation, 1 heavy cnj.
Squat-4x/week (2 front, 2 back)-(1 heavy, 1 between 60-70%. Focus on speed)
Snatch pull-2x/week
Clean pull-2x/week