Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
-- | |
-- Name: c_posts_voted(); Type: FUNCTION; Schema: public; Owner: - | |
-- | |
CREATE FUNCTION c_posts_voted() RETURNS trigger | |
LANGUAGE plpgsql | |
AS $$ BEGIN | |
UPDATE "posts" SET voted_user_ids = array_append(voted_user_ids, NEW.user_id) WHERE "id" = NEW.post_id; | |
RETURN NEW; | |
END; |
import os | |
from flask import Flask, render_template, request | |
import stripe | |
stripe_keys = { | |
'secret_key': os.environ['SECRET_KEY'], | |
'publishable_key': os.environ['PUBLISHABLE_KEY'] | |
} | |
stripe.api_key = stripe_keys['secret_key'] |
import {assertString} from 'plugins/assert' | |
type TemplateContext = { | |
input: string | |
customPrompt?: string | |
} | |
type Template = (context: TemplateContext) => string | |
type ServerPredictionPrompt = { |
.marquee { | |
@apply flex-1 flex overflow-hidden; | |
} | |
.marquee .marquee-inner { | |
@apply truncate flex-1; | |
} | |
.marquee.marquee-active .marquee-inner { | |
@apply flex-none; |
$ = jQuery | |
TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE'] | |
$.activeTransforms = 0 | |
$(document).ajaxSend (e, xhr, settings) -> | |
return unless settings.type in TRANSFORM_TYPES | |
$.activeTransforms += 1 |
function whichTransitionEvent(){ | |
var t; | |
var el = document.createElement('fakeelement'); | |
var transitions = { | |
'transition':'transitionend', | |
'MSTransition':'msTransitionEnd', | |
'MozTransition':'transitionend', | |
'WebkitTransition':'webkitTransitionEnd' | |
} |
$ = jQuery | |
TIMEOUT = 20000 | |
lastTime = (new Date()).getTime() | |
setInterval -> | |
currentTime = (new Date()).getTime() | |
# If timeout was paused (ignoring small | |
# variations) then trigger the 'wake' event | |
if currentTime > (lastTime + TIMEOUT + 2000) |
Clone repo:
git clone git://github.com/maccman/juggernaut.git
cd juggernaut
Create Heroku app:
heroku create myapp --stack cedar
heroku addons:add redistogo:nano
git push heroku master
alex@clearbit.com |
#!/usr/bin/env ruby | |
require File.expand_path('../config/environment', __FILE__) | |
require 'cramp' | |
require 'cramp/controller' | |
Cramp::Controller::Websocket.backend = :thin | |
class SyncroLongPollSubscribe < Cramp::Controller::Action | |
on_start :post_init | |
on_finish :unbind |