Skip to content

Instantly share code, notes, and snippets.

var http = require('http');
var url = require('url');
var port = 9999;
var rooms = {};
var users = {};
console.log('listening on: 9999');
http.createServer(function(req, res) {
@allthetime
allthetime / gist:3be90d230508bc7500dc
Created October 11, 2014 23:09
nginx config for nodeapp
user root;
worker_processes 1;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
#CREATE 20 Venues With locations around Vancouver
names = [
"",
]
addresses = [
"",
]
(function(b) {
var a = {
init: function(c) {
return this.each(function() {
var d = this,
h = b(d).empty();
d.opt = b.extend(true, {}, b.fn.raty.defaults, c);
h.data("settings", d.opt);
d.opt.number = a.between(d.opt.number, 0, 20);
if (d.opt.path.substring(d.opt.path.length - 1, d.opt.path.length) != "/") {
@allthetime
allthetime / gist:292427cc0d9799cc9cf7
Created September 27, 2014 04:49
RATY STARTER KIT
<form action="/" method="post">
<!-- the stars are here in an empty div -->
<div id="rate" name="raty"></div><br>
<!-- this is the hidden input that raty sends the data to -->
<input type="number" name="rating" style="display:none;" id="rating">
<input type="submit">
</form>
<!-- do this for static ratings -->
<div class="rating" data-score="<%= review.rating %>"></div>
class Store < ActiveRecord::Base
has_many :employees
validates :name,
presence: true,
length: {maximum: 25}
integer_and_not_negative = {
numericality: {
only_integer: true,
greater_than_or_equal_to: 0
@allthetime
allthetime / gist:c7f2dae5a4ba39a2b805
Created September 24, 2014 18:08
Venue data parsehub
{
"venue": [{
"name": "VIVO Media Arts Centre",
"address": "2625 Kaslo Street Vancouver BC\nV5M 3G8"
}, {
"name": "PAL Studio Theatre",
"address": "#8th floor-581 Cardero Street Vancouver BC\nV6G3L3"
}, {
"name": "Guilt & Co.",
"address": "1 Alexander Street Vancouver BC"
@allthetime
allthetime / gist:5095087443c86e916543
Created September 19, 2014 17:48
#thehuntforWHITE
%252525252525252525252525ffffff
require 'rspec'
require 'date'
require_relative '../config'
describe Teacher, "can create a teacher" do
before :each do
Teacher.destroy(Teacher.find_by(email:'g@g.com').id) unless Teacher.find_by(email:'g@g.com') == nil
@teacher = Teacher.create!(first_name:'Cow',last_name:'Jensen',gender:'ambigious',birthday:"11-30-88",email:'g@g.com',phone:'666-666-6666')
end
This file has been truncated, but you can view the full file.
Script started on Sat Sep 13 16:06:05 2014
_current_epoch:1: command not found: date
_current_epoch:1: bad math expression: operand expected at `/ 60 / 60 ...'
_current_epoch:1: command not found: date
_current_epoch:1: bad math expression: operand expected at `/ 60 / 60 ...'
%
]2;allthetime@CHRONIC: ~]1;~]2;allthetime@CHRONIC: ~]1;~
allthetime@CHRONIC [04:06:06] [~]
-> % [?1h=zzsh -xv[?1l>