Skip to content

Instantly share code, notes, and snippets.

View maldo's full-sized avatar
🎱

maldo maldo

🎱
View GitHub Profile
@maldo
maldo / gist:5212253
Created March 21, 2013 11:05
Example of mocha testing for https://github.com/justin-john/node-user-management/blob/master/routes/users.js#L107-L146, you can add more testing in error conditions
var should = require('chai').should();
var superagent = require('superagent');
var agent;
describe('testing user', function(){
before(function (done) {
agent = superagent.agent();
// some other operation you need
@maldo
maldo / index.php
Created April 4, 2014 14:15 — forked from amfeng/index.php
<?php
define('CLIENT_ID', 'YOUR_CLIENT_ID');
define('API_KEY', 'YOUR_API_KEY');
define('TOKEN_URI', 'https://connect.stripe.com/oauth/token');
define('AUTHORIZE_URI', 'https://connect.stripe.com/oauth/authorize');
if (isset($_GET['code'])) { // Redirect w/ code
$code = $_GET['code'];
  • casa
  • a bigger project
    • first subtask #1234
    • follow up subtask #4321
    • final subtask cc @mention
  • a separate task
@maldo
maldo / redis_ttl_cleaner.py
Created April 19, 2022 13:59
Redis remove keys
import redis
from itertools import zip_longest
import click
from tqdm import tqdm
from time import sleep
REDIS_HOST = "HOST"
BATCH_SIZE = 500
MAX_TTL = 90 * 24 * 60 * 60