Skip to content

Instantly share code, notes, and snippets.

Avatar

brian herman brianherman

  • A Cons Apart
  • Chicago, Illinois
View GitHub Profile
View interpolation_search.py
import math
import random
def search(array, key):
if len(array) == 0: return -1
hits = 0
max_value = 4294967296
min_value = 0
lower = 0
upper = len(array) - 1
View list of programming languages
A# .NET
A# (Axiom)
A-0 System
A+
A++
ABAP
ABC
ABC ALGOL
ABSET
ABSYS
@brianherman
brianherman / delete.py
Last active Jun 4, 2018
delete github
View delete.py
#pip install pygithub
#python delete.py <username> <token>
#https://github.com/settings/tokens
#Create a token with delete permission and all other repo permission
#https://i.imgur.com/1mrTjTJ.png
import sys
from github import Github
username = sys.argv[1]
token = sys.argv[2]
g = Github(username, token)
View gist:4fd8b9faf2d193777b2f881648961600
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sawtooth.md

https://sawtooth.hyperledger.org/docs/core/releases/latest/_autogen/txn_submit_tutorial.html Generally, to compile Python Protobufs you would follow these instructions to install Google’s Protobuf compiler and manually compile Python classes however you like.

This example will use classes from the Sawtooth Python SDK, which can be compiled by running the executable script bin/protogen.

Sawtooth protocol buffers aren't in the pip package so you have to generate them.

View upgrade sentry
how to upgrade sentry
sudo docker rm -f my-sentry
sudo docker -i -t my-sentry /bin/bash(attach to sentry)
while attached run command:
sentry upgrade
re run sentry with secret key
@brianherman
brianherman / jessie-mssql.md
Last active Jun 15, 2018
Debian Jessie and mssql-server
View jessie-mssql.md

Download mssql from the microsoft website.

wget https://packages.microsoft.com/ubuntu/16.04/mssql-server/pool/main/m/mssql-server/mssql-server_14.0.1.246-6_amd64.deb

dpkg -i mssql-server_14.0.1.246-6_amd64.deb 

The next command will install dependancies.

sudo apt-get -f install 
@brianherman
brianherman / VLC_jessie_backports.md
Last active Nov 9, 2016
Debian on jessie backports/
View VLC_jessie_backports.md

This is a guide to get the latest vlc to work on jessie backports.

$git clone https://github.com/videolan/vlc.git

For some reason libvpadu1 depends on the latest systemd

$sudo apt-get upgrade -t jessie-backports systemd

$sudo apt-get build-dep -t jessie-backports vlc
View dictionaryviewer.py
import sys
import cPickle
from PyQt4.QtCore import *
from PyQt4.QtGui import *
data = {'root': {'persons': {'person': [{'name': {'last': 'bar', 'first': 'foo'}}, {'name': {'last': 'bar', 'first': 'baz'}}]}}}
def fill_item(item, value):
item.setExpanded(True)
View gist:b4174b99be9000fcc4f8
Dim encoder As New System.Text.ASCIIEncoding()
Dim md5Hasher As New System.Security.Cryptography.MD5CryptoServiceProvider()
Dim Password as String = encoder.GetString(md5Hasher.ComputeHash(encoder.GetBytes(PasswordInsTextBox.Text)))
You can’t perform that action at this time.