Skip to content

Instantly share code, notes, and snippets.

Chris Fauerbach chrisfauerbach

Block or report user

Report or block chrisfauerbach

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
@chrisfauerbach
chrisfauerbach / python_fn_parameters.py
Created Aug 20, 2018
Learning python parameters. Curious how to do a mix of arguments, with *args, keyword arguments with *kwargs
View python_fn_parameters.py
#!/usr/local/bin/python3
### Chris. Fauerbach.
### MIT License.
### Most flexible callback method signature if you have
### required and commonly expected keyword arguments
# fn
# callback is a required argument
# *args is everything optional
# counter is a named argument with a default value
View pipenvmetrobus.sh
#!/bin/bash
pipenv --python 3.7
pipenv install metrobus
pipenv shell
@chrisfauerbach
chrisfauerbach / make_emails.py
Created Jul 11, 2018
Generate some convincing email addresses
View make_emails.py
import string
import random
from random import randint, choice
#pip[env] install faker
from faker import Faker
fake = Faker()
DOMAINS = [
View ugly_array.c
#include <stdio.h>
int main(){
unsigned long reference_number = 60000;
unsigned long phone_numbers[65535];
printf( "%lu\n", sizeof(phone_numbers));
phone_numbers[reference_number] = 1;
if ( phone_numbers[reference_number]==1){
printf("Match on = %lu\n", reference_number);
}
View sha256_blazing
$ echo -n “chris@fauie.com” | shasum -a 256 -
View shasum224_blazing
$ echo -n “chris@fauie.com” | shasum -a 224 -
View shasum1_blazing
$ echo -n “chris@fauie.com” | shasum -a 1 - b6b0756bb8a354ddcecc1f89d88cb69646b0c18e -
View naive.go
func nameExists(name string) {
retval boolean := false
database, err = sql.Open("postgres", "postgres://chris@localhost")
if err != nil {
log.Fatal(err)
}
r, _ := database.Query("SELECT EMAIL FROM BLACKLIST WHERE EMAIL = $1", name)
for r.Next() {
var curName string
You can’t perform that action at this time.