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
app_id | min | max | count | sum | inside_hour | |
---|---|---|---|---|---|---|
mm/47048 | 0 | 1920 | 25038 | 25038 | 1 | |
mp/01b6d919ffaf42bab0440b9d0108311b | 1 | 1242 | 590 | 590 | 1 | |
mp/710f154ce60549d4a0ecb0243ebfb2df | 2 | 7 | 3 | 3 | 1 | |
mp/702b29830f9348aaa9b588b518a3dbdf | 14 | 22 | 8 | 8 | 1 | |
mp/adcd2da60f9f4c4e9bdd6cc1ff6e42cb | 4 | 736 | 54 | 54 | 1 | |
mp/b0a95924c4664be791957cec0d18cb11 | 19 | 565 | 23 | 23 | 1 | |
mp/7929d1a5c0964583a83795ffe81cebee | 4 | 3401 | 2534 | 2534 | 1 | |
mp/3ff5f42daa33422fb277622e65747a25 | 54 | 117 | 10 | 10 | 1 | |
mp/a8ad165ba8ae4f838c89644cfa532ba0 | 3 | 3 | 2 | 2 | 1 |
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
-- | |
-- NOTE: this will just give you the original data if the attribute is not present. | |
-- You might need to wrap it in an IF somehow if it's not always there. | |
-- | |
SELECT | |
substring_index(substring_index(TABLE.JSON_COLUMN, '"ATTRIBUTE_TO_EXTRACT": "', -1), '",', 1) | |
from TABLE.JSON_COLUMN | |
-- If the JSON data looks like this: {"key":"value"} instead of this: {"key": "value"} (no space after colon), | |
-- you'll need to use this slightly modified version: |
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
# Find all files matching "src/*.go" and replace "src/%.go" with "bin/%" | |
OUTPUTS := $(patsubst src/%.go,bin/%,$(wildcard src/*.go)) | |
# Reference all files to be built in a single rule | |
all: $(OUTPUTS) | |
# Rule for compiling a single output file in bin/ | |
bin/%: src/%.go | |
# $* is replaced with the value of the wildcard in the rule (%) | |
go build -o bin/$* src/$*.go |
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
def runserver(app, port=5000, profile_log=None): | |
"""Runs a development server.""" | |
from werkzeug.serving import run_with_reloader | |
from werkzeug.debug import DebuggedApplication | |
from werkzeug.contrib.profiler import ProfilerMiddleware | |
app.debug = True | |
port = int(port) |
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 | |
socat -d -d pty,raw,echo=0,link=/tmp/ttysA1 pty,raw,echo=0,link=/tmp/ttysB1 & | |
socat -d -d pty,raw,echo=0,link=/tmp/ttysA2 pty,raw,echo=0,link=/tmp/ttysB2 & | |
socat -d -d pty,raw,echo=0,link=/tmp/ttysA3 pty,raw,echo=0,link=/tmp/ttysB3 & | |
socat -d -d pty,raw,echo=0,link=/tmp/ttysA4 pty,raw,echo=0,link=/tmp/ttysB4 & | |
socat -d -d pty,raw,echo=0,link=/tmp/ttysA5 pty,raw,echo=0,link=/tmp/ttysB5 & |
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 crypto = require('crypto'); | |
var message = 'GET /foo/bar?arg1=aaaa&arg2=bbbb'; | |
var secret = 'secret'; | |
crypto.createHmac('sha256', secret).update(message).digest('base64'); | |
// '82LHSJc4h/5BpLrBcGyWjTIiLuJTBYkgyGAb7cNmXew=' |
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
#!/usr/bin/env node | |
var spawn = require('child_process').spawn; | |
var extname = require('path').extname; | |
// where to store the virtual ports while running | |
var virtual_port_dir = '/tmp/'; | |
// socat displays this when successfully connected | |
var success_str = 'starting data transfer loop'; |
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
/** | |
* Simple jQuery plugin that replaces $.click with a mobile-responsive version | |
* that doesn't break scrolling. | |
*/ | |
(function($){ | |
$.fn.extend({ | |
clickTouch: function(handler) { | |
return this.each(function() { | |
var touchedWithoutScroll = false; | |
var self = $(this); |
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
require | |
global | |
process | |
console | |
log | |
error | |
warning | |
Buffer | |
__filename | |
__dirname |
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 | |
# virtualenv-auto-activate.sh | |
# | |
# Installation: | |
# Add this line to your .bashrc or .bash-profile: | |
# | |
# source /path/to/virtualenv-auto-activate.sh | |
# | |
# Go to your project folder, run "virtualenv .venv", so your project folder | |
# has a .venv folder at the top level, next to your version control directory. |
NewerOlder