Skip to content

Instantly share code, notes, and snippets.

View willie's full-sized avatar

Willie Abrams willie

View GitHub Profile
@willie
willie / review parser
Created June 8, 2023 18:42 — forked from stfj/review parser
parses reviews from appfigures
import poplib
import smtplib
from email import message_from_bytes
from email.message import EmailMessage
import openai
import re
import html
openai.api_key = ''
package main
import (
"fmt"
"math/rand"
"time"
)
type Coalescer[T any] struct {
state chan state[T]
@willie
willie / Sieve.swift
Last active October 15, 2018 21:52 — forked from mattt/Sieve.swift
Sieve of Eratosthenes with Accelerate
// Calculate prime numbers in a given range
// using Sieve of Eratosthenes
import Accelerate
var primes: [Int] = []
let range = 0...1000
var numbers = range.map(Float.init)
@willie
willie / groupcache.go
Created April 28, 2018 03:41 — forked from fiorix/groupcache.go
Simple groupcache example
// Simple groupcache example: https://github.com/golang/groupcache
// Running 3 instances:
// go run groupcache.go -addr=:8080 -pool=http://127.0.0.1:8080,http://127.0.0.1:8081,http://127.0.0.1:8082
// go run groupcache.go -addr=:8081 -pool=http://127.0.0.1:8081,http://127.0.0.1:8080,http://127.0.0.1:8082
// go run groupcache.go -addr=:8082 -pool=http://127.0.0.1:8082,http://127.0.0.1:8080,http://127.0.0.1:8081
// Testing:
// curl localhost:8080/color?name=red
package main
import (
@willie
willie / gist:f99a06072eba563a8946d48f13b3312d
Last active April 9, 2018 21:07
part of my docker file where I build pdfium
# install PDFium
WORKDIR /
RUN apt-get install -y libgtk2.0-dev
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH /depot_tools:"$PATH"
RUN gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git; \
gclient sync
@willie
willie / keybase.md
Created May 25, 2017 19:26
keybase.md

Keybase proof

I hereby claim:

  • I am willie on github.
  • I am willieabrams (https://keybase.io/willieabrams) on keybase.
  • I have a public key ASCEciq5KhoAXpNovmmrKPdvpfY5fGWWZOoR05oqGPAXMQo

To claim this, I am signing this object:

@willie
willie / caddy-test.go
Created June 18, 2016 15:19
getting error: "cannot create storage without CA URL"
package main
import (
"github.com/mholt/caddy"
// plug in the server
_ "github.com/mholt/caddy/caddyhttp"
"log"
)
@willie
willie / uninstall_vmware.sh
Created April 15, 2016 14:40 — forked from boneskull/uninstall_vmware.sh
completely uninstall vmware on mac
#!/usr/bin/env bash
# Usage: bash uninstall_vmware.bash
remove() {
entry="$1"
echo -ne "Removing \e[1;34m$entry\e[0m... "
sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log
if [[ ! -e "$entry" ]]; then
echo -e "\e[1;32mOK\e[0m"

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@willie
willie / echo.c
Created October 7, 2009 20:39 — forked from jacobian/echo.c
fixes OS X address binding problem
/**
* A simple preforking echo server in C.
*
* Building:
*
* $ gcc -Wall -o echo echo.c
*
* Usage:
*
* $ ./echo