Skip to content

Instantly share code, notes, and snippets.

@florean
florean / simple_fizzbuzz.c
Created August 2, 2018 20:25
A simple FizzBuzz that uses counters instead of division.
#include <stdio.h>
int main() {
unsigned int fb = 0x0F0305; // 15 for fizzbuzz, 3 for fizz, and 5 for buzz
for (unsigned int i = 1; i < 101; i++) {
fb -= 0x010101; // Decrement one from each counter.
if (fb < 0X010000) {
fb = 0x0F0305; // Reset all counters to original value;
printf("fizzbuzz\n");
} else if ((fb & 0xFFFF) < 0x0100) {
@florean
florean / dmv_scraper.py
Created September 10, 2016 21:23
A simple example of scraping a WA Department of Licensing web page and pulling out the wait times.
from lxml import html
import requests
import re
# URL for DMV office page.
DMV_URL = "https://fortress.wa.gov/dol/dolprod/dsdoffices/OfficeInfo.aspx?cid=45&oid=23"
# Get the page content.
page = requests.get(DMV_URL)

Keybase proof

I hereby claim:

  • I am florean on github.
  • I am florean (https://keybase.io/florean) on keybase.
  • I have a public key whose fingerprint is CB08 0B37 38DB C7FC B165 5611 AA3C FFF5 479B 9638

To claim this, I am signing this object: