Skip to content

Instantly share code, notes, and snippets.

View rf's full-sized avatar

Russ Frank rf

  • Oden Technologies
  • Brooklyn, NY
View GitHub Profile
mysql> SELECT DATE(date) Date, COUNT(DISTINCT uuid) totalCOunt FROM analytics where date > now() - interval 1 month and date < now() GROUP BY DATE(date);
+------------+------------+
| Date | totalCOunt |
+------------+------------+
| 2014-01-04 | 1343 |
| 2014-01-05 | 2912 |
| 2014-01-06 | 3579 |
| 2014-01-07 | 3132 |
| 2014-01-08 | 3096 |
| 2014-01-09 | 3022 |
@rf
rf / out
Created April 26, 2014 18:52
{"metadata":{"category":{"id":"mens-lace-up-shoes","name":"Lace-up Shoes"},"showSizeFilter":true,"showColorFilter":true,"offset":0,"limit":20,"total":12818},"products":[{"id":440435890,"name":"Magnanni Suede Oxford Shoe, Cacao","type":"product","currency":"USD","price":279,"priceLabel":"$279.00","salePrice":181.35,"salePriceLabel":"$181.35","inStock":true,"retailer":{"id":"750","name":"Last Call by Neiman Marcus","url":"http://www.shopstyle.com/browse/Last-Call-by-Neiman-Marcus-US?pid=uid8089-24933283-78"},"locale":"en_US","description":"<ul> <li>Suede upper.</li> <li>Oxford lace-up style; waxed laces.</li> <li>Squared toe.</li> <li>Leather lining.</li> <li>1\" flat heel.</li> <li>Leather sole with rubber insets.</li> <li>Made in Spain.</li> </ul>","brand":{"id":"1595","name":"Magnanni","url":"http://www.shopstyle.com/browse/Magnanni?pid=uid8089-24933283-78"},"clickUrl":"http://api.shopstyle.com/action/apiVisitRetailer?id=440435890&pid=uid8089-24933283-78","pageUrl":"http://www.shopstyle.com/p/magnanni-suede-
{
"metadata": {
"category": {
"id": "mens-lace-up-shoes",
"name": "Lace-up Shoes"
},
"showSizeFilter": true,
"showColorFilter": true,
"offset": 0,
"limit": 20,
module.exports = Ready
function Ready() {
var ready = false
var listeners = []
var args
onready.emit = onready
onready.ready = false
@$(PYTHON) $(IOS_BUILDER) distribute $(IOS_VER) "`pwd`/build/iphone"\
$(IOS_ID) $(APP_NAME) $(MOBILEPROVISION) \
$(DEVIDENT) "`pwd`/build/" universal | egrep -v '[DEBUG]'
ios-ipa : os-sanity clean clean-src update-rev fonts iphone-images ipad-images
@echo "Executing Titanium build script for iPhone .."
@mkdir -p build/iphone/build/iphone/
@$(PYTHON) $(IOS_BUILDER) distribute $(IOS_VER) "`pwd`/build/iphone"\
$(IOS_ID) $(APP_NAME) $(MOBILEPROVISION) \
$(DEVIDENT) "`pwd`/build/" universal | egrep -v '[DEBUG]'
/usr/bin/xcrun -sdk iphoneos PackageApplication -v \
"build/iphone/build/iphone/build/Release-iphoneos/$(APP_NAME).app" \
-o "`pwd`/build/$(APP_NAME).ipa" \
--sign $(DISTRIB_PROFILE) \
// assuming json string is in `data`
var sections = {},
sectionsArray = [],
section;
try {
data = JSON.parse(data);
data.forEach(function (item) {
if (!sections[item.avatar_id]) {
// we haven't created this section yet
sections[item.avatar_id] = Ti.UI.createTableViewSection();
var dataset = [Row_4, Row_5, (function () { if (class_tf.value === 'Other') return srRow_6; }())];
////////////////////////////////////////////////////////////////////////
var dataset = [];
dataset.push(Row_4);
dataset.push(Row_5);
@rf
rf / gist:1813857
Created February 13, 2012 05:12 — forked from parshap/gist:1813827
irc - async example
// Get a list of rooms...
socket.on('list rooms', function(data){
client.smembers('rooms', function(err, rooms){
var remaining = rooms.length,
array = []
async.forEach(rooms, function (room, done) {
client.hgetall('room_' + room, function (e, result) {
array.push(result);
done();
<?php
# Run an HTTP POST on the specified url, sending json.
function post ($url, $data) {
$ch = curl_init();
$json = json_encode($data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);