Skip to content

Instantly share code, notes, and snippets.

View chrisfauerbach's full-sized avatar

Chris Fauerbach chrisfauerbach

View GitHub Profile
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
$ echo -n “chris@fauie.com” | shasum -a 1 - b6b0756bb8a354ddcecc1f89d88cb69646b0c18e -
$ echo -n “chris@fauie.com” | shasum -a 224 -
$ echo -n “chris@fauie.com” | shasum -a 256 -
#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);
}
@chrisfauerbach
chrisfauerbach / make_emails.py
Created July 11, 2018 00:34
Generate some convincing email addresses
import string
import random
from random import randint, choice
#pip[env] install faker
from faker import Faker
fake = Faker()
DOMAINS = [
#!/bin/bash
pipenv --python 3.7
pipenv install metrobus
pipenv shell
@chrisfauerbach
chrisfauerbach / python_fn_parameters.py
Created August 20, 2018 15:45
Learning python parameters. Curious how to do a mix of arguments, with *args, keyword arguments with *kwargs
#!/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