Skip to content

Instantly share code, notes, and snippets.

🔥
doing codes

Daniel Compton dan-compton

🔥
doing codes
Block or report user

Report or block dan-compton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c1b8d5ed441efa64b8bf
//used something like this in a disclosure to sauceyapp.com regarding bruteforcing
package main
import (
"bytes"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
@dan-compton
dan-compton / exponentialbackoff.go
Created Feb 22, 2016
Exponential backoff that takes a clojure
View exponentialbackoff.go
// something like
type clj func() (interface{}, error)
func DoWithBackoff(retries int, fn clj) (interface{}, error) {
for try := 0; try < retries; try++ {
output, err := fn()
if err != nil || try < 6 { // Todo(you) remove || try < 6
log.WithError(err).Error("Failed to execute.")
continue
} else {
View blah.py
import collections
import pprint
import operator
d = collections.defaultdict(int)
z = {}
original = '''FNNVRJAINVMUHZBJLTXFEMNVAINVMUOWUCNVNVRJCKXFWELTNVWXTZMUAIBJ'''
print 'total chars:',len(original)
for c in original:
@dan-compton
dan-compton / gist:9f6e3b4a09f1caf2c44d
Created Oct 10, 2015
Bruteforce saucey promocodes
View gist:9f6e3b4a09f1caf2c44d
package main
import (
"bytes"
log "github.com/Sirupsen/logrus"
"io/ioutil"
"math/rand"
"net/http"
"sync"
"time"
View keybase.md

Keybase proof

I hereby claim:

  • I am dan-compton on github.
  • I am dacompton (https://keybase.io/dacompton) on keybase.
  • I have a public key whose fingerprint is 7F77 DA08 DBE5 A809 C90C AA47 445D 96F2 B57A FB74

To claim this, I am signing this object:

@dan-compton
dan-compton / timestamp.go
Created Oct 5, 2015 — forked from bsphere/timestamp.go
UNIX timestamps in Golang
View timestamp.go
package timestamp
import (
"fmt"
"labix.org/v2/mgo/bson"
"strconv"
"time"
)
type Timestamp time.Time
@dan-compton
dan-compton / terminator-config
Last active Aug 29, 2015 — forked from jacaetevha/terminator-config
save this file to ~/.config/terminator
View terminator-config
[global_config]
enabled_plugins = CustomCommandsMenu, InactivityWatch, TestPlugin, ActivityWatch, TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, MavenPluginURLHandler, LaunchpadBugURLHandler, LayoutManager
title_transmit_bg_color = "#832527"
[keybindings]
[profiles]
@dan-compton
dan-compton / set_devenv_ubuntu64.sh
Last active Aug 29, 2015
Bash script to set up my development environment in Ubuntu64
View set_devenv_ubuntu64.sh
#!/bin/sh
mkdir ~/.provision
cd ~/.provision
sudo apt-get install vim
sudo apt-get install git
sudo apt-get install terminator
echo "installing source code pro..."
wget https://gist.githubusercontent.com/lucasdavila/3875946/raw/1c100cae16a06bef154af0f290d665405b554b3b/install_source_code_pro.sh
View vim_setup_osx.sh
git clone git://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
brew install ctags
echo "set nu" >> ~/.vimrc
echo "set paste" >> ~/.vimrc
echo "set color vim-irblack" >> ~/.vimrc
echo "set guifont=Source\ Code\ Pro\ 14" >> ~/.vimrc
echo ".vimrc set nu, set paste, set color vim-irblack"
echo "installing terminator config"
You can’t perform that action at this time.