Skip to content

Instantly share code, notes, and snippets.

View tjmehta's full-sized avatar
💭
🌉

Tejesh Mehta tjmehta

💭
🌉
View GitHub Profile
foreign foreign foreign [Applause] thank you the committee will come to order without objection the chair is authorized to declare a recess of the committee at any time this hearing is entitled the annual testimony of the Secretary of the Treasury on the state of the International Financial system without objection all members will have five legislative days within which to submit extraneous materials to the chair for inclusion in the record I will note if the outside of this hearing that we have a hard stop as a courtesy to the secretary at 1 pm this afternoon we will strictly observe it now I'll recognize myself for four minutes to give an opening statement welcome secretary Yellen I appreciate you being here today today's hearing is about the state of the international financial institutions but I do want to take a minute and talk about the debt ceiling crisis that we narrowly avoided first we're all glad that this is behind us no one wanted default no legislative branch official no executive branch offici

Keybase proof

I hereby claim:

  • I am tjmehta on github.
  • I am tjmehta (https://keybase.io/tjmehta) on keybase.
  • I have a public key ASBdiqNrVKvhZkXTt76rhWnhh1KbIDrW0kM3WCtI0nSWSAo

To claim this, I am signing this object:

@tjmehta
tjmehta / redis-expire.sh
Created July 8, 2018 05:57 — forked from fieg/redis-expire.sh
Set expire on large set of keys using pattern in Redis
#!/bin/bash
if [ $# -ne 4 ]
then
echo "Usage: $0 <host> <port> <pattern> <seconds>"
exit 1
fi
cursor=-1
keys=""
@tjmehta
tjmehta / dataview-polyfill.js
Created April 5, 2016 00:05
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
{
//...
// plugins
plugins: [
'karma-*',
{
'middleware:custom': ['factory', function (config) {
return function (req, res, next) {
console.log('HELLO!')
res.end('hello-world')
@tjmehta
tjmehta / publish-static.js
Created February 9, 2016 23:09
Publish all expose ports to 1-to-1 w/ docker host
#!/usr/bin/env node
# Usage: docker run [..opts] `publish-static <image>:<tag>`
'use strict'
const execSync = require('child_process').execSync
const image = process.argv[2]
const inspect = JSON.parse(
execSync('docker inspect ' + image).toString()
@tjmehta
tjmehta / domains-emitter-example.js
Last active October 12, 2015 18:04
Unexpected domain error handling
var Domain = require('domain')
var d1 = Domain.create();
var emitter;
d1.on('error', handleCreateErr)
d1.run(function () {
emitter = createEmitter()
})
var d2 = Domain.create();
#!/usr/bin/python3
# Collect information about a crash and create a report in the directory
# specified by apport.fileutils.report_dir.
# See https://wiki.ubuntu.com/Apport for details.
#
# Copyright (c) 2006 - 2011 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify it
ERROR: apport (pid 23850) Tue Sep 1 21:07:32 2015: Unhandled exception:
Traceback (most recent call last):
File "/usr/share/apport/apport", line 54, in drop_privileges
stat = os.stat('/proc/' + pid)
FileNotFoundError: [Errno 2] No such file or directory: '/proc/43'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/apport/apport", line 276, in <module>
@tjmehta
tjmehta / javascript-object-to-querystring.js
Last active October 31, 2024 23:25
Object to Querystring - JavaScript, JS, JSON
function objectToQuerystring (obj) {
return Object.keys.reduce(function (str, key, i) {
var delimiter, val;
delimiter = (i === 0) ? '?' : '&';
key = encodeURIComponent(key);
val = encodeURIComponent(obj[key]);
return [str, delimiter, key, '=', val].join('');
}, '');
}