Skip to content

Instantly share code, notes, and snippets.

View pauliusuza's full-sized avatar
🔥
On fire

Paulius Uza pauliusuza

🔥
On fire
View GitHub Profile
with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt
@seanadkinson
seanadkinson / herokuRelease.js
Last active August 29, 2015 14:13
Heroku Current Version Number in Node.js
var _ = require('lodash'),
Heroku = require('heroku-client'),
heroku = new Heroku({ token: process.env.HEROKU_API_KEY });
var app = heroku.apps('application-name');
app.releases().list(function(err, releases) {
var version = _.max(_.pluck(releases, 'version'));
console.log("APP_VERSION: " + version);
process.env.APP_VERSION = version;
@jenschelkopf
jenschelkopf / hot-cloud-swap-script.md
Last active August 9, 2019 21:05
Cheat Sheet for the FoundationDB 'Hot Cloud Swap' Screencast

Cheat Sheet for the FoundationDB 'Hot Cloud Swap' Screencast

Initial Cluster Setup on Digital Ocean

Grab the client and server packages from the FoundationDB website

ansible -i inventory digital_ocean -a "wget https://foundationdb.com/downloads/f-nbxofdxnoxocd/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/2.0.9/foundationdb-clients_2.0.9-1_amd64.deb https://foundationdb.com/downloads/f-nbxofdxnoxocd/I_accept_the_FoundationDB_Community_License_Agreement/key-value-store/2.0.9/foundationdb-server_2.0.9-1_amd64.deb"

Install the client and server packages

<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.0.23.min.js"></script>
<script>
var SightingObject;
var db;
@scttnlsn
scttnlsn / README.md
Created July 30, 2012 22:16
Pub/sub with MongoDB and Node.js

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
@aheckmann
aheckmann / prepopulate.js
Created July 27, 2012 21:43
mongoose prepopulate
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
@debloper
debloper / index.html
Created December 14, 2011 11:37
Pulsating HTML Element with just pinchful of CSS Animation
<!DOCTYPE html>
<html>
<head>
<title>CSS Pulsator</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="pulsor">Pulsate!</div>
</body>
</html>
@cowboy
cowboy / HEY-YOU.md
Last active February 27, 2025 12:24
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.