This file contains 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
var base = this; | |
if ( !base.init ) { | |
// Mark that we've ran the init code | |
base.init = true; | |
// Starting frame number | |
base.frames = 0; | |
// Amount of frames per second |
This file contains 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
from datetime import datetime | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
from redis import Redis | |
from rq_scheduler import Scheduler | |
from rq_scheduler.utils import to_unix | |
class CustomRQScheduler(Scheduler): |
This file contains 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
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
This file contains 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
#!/bin/bash -ex | |
# install needed packages for ansible | |
apt-get install -y -q python-paramiko python-yaml python-jinja2 python-simplejson | |
apt-get install -y -q git-core | |
# get ansible -- :) | |
git clone git://github.com/ansible/ansible.git | |
cd ./ansible |
This file contains 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
// create a 2d array | |
function createGrid(rows, columns) { | |
var grid = new Array(rows); | |
for(var i = 0; i < rows; i++) { | |
grid[i] = new Array(columns); | |
for(var j = 0; j < columns; j++) { | |
grid[i][j] = 0; | |
} | |
} | |
return grid; |
This file contains 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
// create a 2d array | |
function createGrid(rows, columns) { | |
var grid = new Array(rows); | |
for(var i = 0; i < rows; i++) { | |
grid[i] = new Array(columns); | |
for(var j = 0; j < columns; j++) { | |
grid[i][j] = 0; | |
} | |
} | |
return grid; |
This file contains 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 setupFormSave($form, xhrOptions, autoSave) { | |
xhrOptions = xhrOptions || {}; | |
var lastFormData = $form.serialize(); | |
xhrOptions.url = xhrOptions.url || $form.attr('action'); | |
xhrOptions.type = xhrOptions.type || $form.attr('type'); | |
var $saveButton = $form.find('button[type="submit"]'); | |
var $saveStatus = $($saveButton.attr('data-update')); | |
function changeButtonText(message) { |
This file contains 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
FROM ubuntu | |
MAINTAINER shrikrishna <shrikrishna.holla@gmail.com> | |
# update OS | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get upgrade -y | |
# Install depndencies | |
RUN apt-get install -y ruby1.9.1-dev build-essential git openssh-server vim |
This file contains 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
SELECT | |
sum(view_homepage) AS viewed_homepage, | |
sum(use_demo) AS use_demo, | |
sum(enter_credit_card) AS entered_credit_card | |
FROM ( | |
-- Get the first time each user viewed the homepage. | |
SELECT | |
user_id, | |
1 AS view_homepage, | |
min(time) AS view_homepage_time |
This file contains 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
Anything added dilutes everything else. | |
Approachable is better than simple. | |
Avoid administrative distraction. | |
Design for failure. | |
Encourage flow. | |
Favor focus over features. | |
Half measures are as bad as nothing at all. | |
It's not fully shipped until it's fast. | |
Keep it logically awesome. | |
Mind your words, they are important. |
OlderNewer