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 STRIPE_SECRET_KEY = 'YOUR_KEY'; | |
var OBJECTS_PER_REQUEST = 100; | |
var stripe = require('stripe')(STRIPE_SECRET_KEY); | |
function processSubs(err, subs) { | |
if (err) { | |
console.log(err); | |
return; |
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
SHOW FULL PROCESSLIST; | |
SHOW ENGINE INNODB STATUS; | |
SELECT table_schema "db", SUM(data_length + index_length) / 1024 / 1024 | |
"mb" FROM information_schema.TABLES GROUP BY table_schema ORDER BY mb DESC; | |
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
javascript:(function(){d=document;jq=d.createElement('script');jq.src ="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";d.getElementsByTagName('head')[0].appendChild(jq);setTimeout(function(){jQuery.noConflict();},1000);})() |
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
/** | |
* Format number (integer). | |
* @param n | |
*/ | |
{template .formatNumber} | |
{let $x: floor($n) /} | |
{if $x >= 1000 and $x < 1000000000} | |
{if $x < 1000000} | |
{floor($x / 1000)}, | |
{else} |
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
# Pebble UUID generator | |
function pebble_uuid { | |
uuid_string=`uuidgen | sed "s/-//g"` | |
uuid="#define MY_UUID {" | |
for i in {0..15}; do | |
if [ $i -ne 0 ]; then | |
uuid="$uuid," | |
fi | |
uuid="$uuid 0x${uuid_string:$[i*2]:2}" | |
done |
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
void writeBuffer(char *pPath, uint8_t *pBuffer, int width, int height, int channels) { | |
int x, y, j, c; | |
FILE *p = fopen(pPath, "wb"); | |
for (y = 0; y < height; y++) { | |
for (x = 0; x < width; x++) { | |
for (c = 0; c < channels; c++) { | |
uint8_t buf[1]; | |
j = (y * width + x) * channels + c; | |
buf[0] = pBuffer[j]; | |
fwrite(buf, 1, sizeof(buf), p); |