Skip to content

Instantly share code, notes, and snippets.

View dreamingbinary's full-sized avatar
💭
I love to build

Charles Le dreamingbinary

💭
I love to build
  • Los Angeles, Earth.
View GitHub Profile
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
#!/bin/sh
#for i in $(networksetup -listallhardwareports | grep Device | gawk '{print $2}')
for i in $( ifconfig -l )
do
echo "\"$i\" :" \"$(ipconfig getifaddr $i)\"
# grep -e 'en*' -e 'tun*'
done
@dreamingbinary
dreamingbinary / Dictionary-Interpolation.py
Last active July 7, 2016 08:43
Python dict-style interpolation
print("Executing on %s as %s" % (env.host, env.user))
# Using dict-style interpolation is more readable and slightly shorter:
print("Executing on %(host)s as %(user)s" % env)
# Reference: http://docs.fabfile.org/en/1.11/usage/env.html
<!DOCTYPE html>
<html>
<body>
<?php
if(!isset($_POST['test_field'])) {
print $_POST['test_field'];
}
?>
<form method="POST" action="<?PHP print $_SERVER['PHP_SELF']; ?>">
@dreamingbinary
dreamingbinary / .wakeup
Created September 6, 2016 17:43 — forked from ralph089/.wakeup
Restarts Bluetooth Module on Mac OS X El Capitan. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See README.md). I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@dreamingbinary
dreamingbinary / stripe_analytics.py
Created February 22, 2017 08:14
Jorge's Stripe Analytics File
import os
import string
import json
R=[]
ii=0
data_id='#######################'
found=0
while ii<2000:
if ii>=0:
modstart='-d starting_after='+str(data_id)+''

Keybase proof

I hereby claim:

  • I am dreamingbinary on github.
  • I am dreamingbinary (https://keybase.io/dreamingbinary) on keybase.
  • I have a public key whose fingerprint is 7975 E06A 475A 311F BF0A A735 3D23 2410 B0F1 A915

To claim this, I am signing this object:

@dreamingbinary
dreamingbinary / gist:78cf868339b1b222b605339f60550782
Last active January 2, 2018 07:25
SSH PUBLIC KEY - cle-mbprt
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDJh8yLFcPuFh6ABHE108B/qUGnsMgkxatwc8tv05kUZv/EDoHd9SzBR8WFK9iB0so6R9Km8uDn7C2bVF9Y7ANaC+avBZrqMo9VGDuHhDRh0pjP3QSzun87gEYSvXQnh1x9AZfDuqoJaGQc1B4EAMsEUZzkqFS43/8pa61Rs0mnoh7iKI8sOOK8RweFGcNXVcdpvRhEOWOhAAFcr1ufR/v2hTMrgRnKXYVeaF071RuWDg0sO198wMVWchqksUmh894PrfT1it8RmgjLyQOgoqDVndCPsTnazmFvDIdSYCf46/PbVBirodEZynbfwqOEGGUNhKwuleJ0QlaGy5r45Zni7+9dbXUtPeCT0CQteOZJZhkF+OlDczFXbbwIfZ89q2FHi4ubmZMvZjsXGjvQDbWSFYFFNdWx+6PUnpmtoRX1hSUHwaSX84m9zXLNJf/fyTRLoGjoQuJ4ikH2csd2qQOO/OGMNfuZQkxhqA2B0tdpypPs18QsgwvSPXcGXUMRarn0/inpNqw0UWtnTmKPnORGS3Am+TR1PzKvpV4ZVdc3OD+QKqmrnzzPlX1rxfbdCDvAHkvq21YiLlamZu9rilk4R0szJj4ZySlqYLsW6pmYhc7N+4AS3oMZ8MktqdMh3+iqKSoaDNBbcnJ1idlnRadNJD1DCYFLoBDp0QJiFh2ZkQ== (cle-mbprt)
@dreamingbinary
dreamingbinary / introrx.md
Created April 19, 2018 22:31 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing