This file contains hidden or 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
local fn = vim.fn | |
local install_path = '~/.local/share/nvim/site/pack/packer/start/packer.nvim' | |
vim.cmd [[packadd packer.nvim]] | |
local function load_plugins() | |
local use = require('packer').use | |
require("packer").startup( | |
{ | |
function() |
This file contains hidden or 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
package bitflags | |
import ( | |
"bytes" | |
"unicode" | |
"github.com/gogo/protobuf/protoc-gen-gogo/generator" | |
"github.com/opsee/protobuf/opseeproto" | |
) |
This file contains hidden or 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
grammar Jsonnet; | |
jsonnet | |
: expr EOF | |
; | |
expr | |
: value=(NULL | TRUE | FALSE | SELF | DOLLAR | STRING | NUMBER ) # Value | |
| '(' expr ')' # Parens | |
| '{' objinside? '}' # Object |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
VERSION="1.9.3" | |
if [ -n "`$SHELL -c 'echo $ZSH_VERSION'`" ]; then | |
# assume Zsh | |
shell_profile="zshrc" | |
elif [ -n "`$SHELL -c 'echo $BASH_VERSION'`" ]; then | |
# assume Bash |
This file contains hidden or 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
/* | |
Given the protobuf below, generates the following funcs so that the message can be used as bitflags: | |
func (this *User) UInt64() uint64 { | |
b := uint64(0) | |
if this.ScopeA { | |
b |= uint64(1) << uint64(0) | |
} | |
if this.ScopeB { | |
b |= uint64(1) << uint64(1) |
This file contains hidden or 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
# CONTAINER_TAG is git revision unless overriden by YOURPROJ_VERSION | |
CONTAINER_TAG := $(shell git rev-parse HEAD) | |
ifeq ($(YOURPROJ_VERSION), "") | |
CONTAINER_TAG := $(YOURPROJ_VERSION) | |
endif | |
CONTAINER_NAME := "docker/yourproj" | |
CONTAINER_PORTS := "7000:7000" | |
all: clean deps build |
This file contains hidden or 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
//used something like this in a disclosure to sauceyapp.com regarding bruteforcing | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io/ioutil" | |
"math/rand" | |
"net/http" |
This file contains hidden or 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
// 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 { |
This file contains hidden or 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
import collections | |
import pprint | |
import operator | |
d = collections.defaultdict(int) | |
z = {} | |
original = '''FNNVRJAINVMUHZBJLTXFEMNVAINVMUOWUCNVNVRJCKXFWELTNVWXTZMUAIBJ''' | |
print 'total chars:',len(original) | |
for c in original: |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
log "github.com/Sirupsen/logrus" | |
"io/ioutil" | |
"math/rand" | |
"net/http" | |
"sync" | |
"time" |
NewerOlder