Skip to content

Instantly share code, notes, and snippets.

View abachman's full-sized avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
@abachman
abachman / templates.md
Created January 5, 2021 02:27
new tab Template block demos

cat facts

url: https://cat-fact.herokuapp.com/facts

code:

<div style="border: 1px solid black;padding: 5px;">
  <h3 style="padding:0;margin:0">CAT FACTS</h3>
  {% for fact in data %}
 {{ fact.text }}
@abachman
abachman / colorWiring breakdown.md
Created October 17, 2020 15:04
turning RGB into GRB

pieces you asked about:

// translate the 24 bit color from RGB to the actual
// order used by the LED wiring.  GRB is the most common.
int colorWiring(int c) {
  int red = (c & 0xFF0000) >> 16;
  int green = (c & 0x00FF00) >> 8;
  int blue = (c & 0x0000FF);
  red = gammatable[red];
@abachman
abachman / README.md
Last active August 27, 2020 18:02
How to Become a Cryptographer

Retrieved from Reddit 2015-12-10

As an undergrad who has recently become very interested in this field, I would like to know of a roadmap to develop a solid foundation in order to pursue a research career in cryptography. Things like course sequence, major/concentration, books, etc would be helpful.

Currently I'm a second year CS student and have noticed that my school's program focuses more on the practical side of things. Since cryptography requires a deep understanding of some abstract areas of math, would it be best to transfer to a pure math program?

Thanks in advance!

You should definitely have solid mathematical skills, but computer science helps as well. I did both (bachelors in both, masters in both, PhD in a mathematics/CS hybrid department).

@abachman
abachman / textarea-bonanza.rb
Last active June 5, 2020 00:23
grid height bug?
#!/usr/bin/env ruby
#
# Demo of the "severe typing lag" layout bug we found.
#
# Things that fix the lag:
# - set textarea width to a non-percentage value
# - set .container grid-template-rows: to anything other than `auto`, e.g.,
# `100vh` or `100%` work; or remove the property
# - set .container height: to a fixed value or remove the property
@abachman
abachman / gist:78702
Created March 13, 2009 18:55
A bash script for listing directory trees (with color)
#!/usr/bin/env bash
#
# This script produces a complete tree structure for the directory
# in which it is running.
#
# FROM
# http://www.sun.com/bigadmin/scripts/submittedScripts/lstree.sh.txt
#
# Modifications by Adam Bachman
#
@abachman
abachman / chart.html
Created June 19, 2019 02:50
Adafruit IO public feed data chart
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.css" />
<style>
body {
margin: 0; padding: 0;
@abachman
abachman / aphex-001.rb
Created November 7, 2017 23:04
aphex-001
# for Sonic Pi - http://sonic-pi.net/
live_loop :flibble do
set :n, rrand_i(1, 9)
sample :tabla_na, rate: 0.9 / (get[:n] / 2.0), amp: 1.0 / get[:n]
sleep 1.0 / get[:n]
end
live_loop :bass do
use_synth :growl
@abachman
abachman / index.html
Created April 22, 2019 19:10
MICAVIBE style p5.js coding environment
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script>
<script src="support.js"></script>
<script src="sketch.js"></script>
@abachman
abachman / trellis-keyboard.py
Created November 7, 2018 02:08
CircuitPython Trellis M4 Keyboard Demo
# CircuitPython + Trellis M4 Keyboard emulator. Fits in your pocket!
# using https://www.adafruit.com/product/4020
#
# Should work on any PC
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
@abachman
abachman / arduino_hearts_processing.ino
Created November 20, 2018 17:24
Arduino ❤️ Processing
/*
Publish from an ESP8266 to a generic TCP server.
This sketch uses the simplest protocol possible
to send numbers over the wire.
*/
#include <ESP8266WiFi.h>