Skip to content

Instantly share code, notes, and snippets.

View agarie's full-sized avatar

Carlos Agarie agarie

View GitHub Profile
(Chapters marked with * are already written. This gets reorganized constantly
and 10 or so written chapters that I'm on the fence about aren't listed.)
Programmer Epistemology
* Dispersed Cost vs. Reduced Cost
* Verificationist Fallacy
* Mistake Metastasis
The Overton Window
Epicycles All The Way Down
The Hyperspace Gates Were Just There
@mqu
mqu / arduino-serial.ino
Created March 31, 2015 05:21
simple ruby example to read and write bytes to Arduino serial port.
uint8_t c;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(4800); // 8E2 : 8bits, 2 stops bits, even parity.
// Serial.begin(4800, SERIAL_8E2); // 8E2 : 8bits, 2 stops bits, even parity.
while (!Serial) {
@Profpatsch
Profpatsch / hlint-to-github-warnings.jq
Last active March 21, 2023 13:56
Convert hlint warnings to github Action “smart” log messages
# the github message format requires newlines to be escaped with the URL-style %0A
# see https://github.com/actions/toolkit/issues/193#issuecomment-605394935
def escapeNewline: gsub("[\\n]"; "%0A");
# depending on the hlint message, we want to display the
# headings and the bodies differently
def prepareTitle:
if .hint == "Unused LANGUAGE pragma"
then { heading: "Unused LANGUAGE pragma: \(.from)"
, suggestion: ""
@jasongraham
jasongraham / less_converter.rb
Created October 22, 2010 04:14
A Jekyll plugin to convert a .less file to .css
module Jekyll
# Compiled LESS CSS into CSS. You must specify an empty YAML front matter
# at the beginning of the file.
# .less -> .css
class LessConverter < Converter
safe true
priority :low
pygments_prefix "\n"
pygments_suffix "\n"
@ainsleyrutterford
ainsleyrutterford / pokemon-weaknesses.json
Created August 25, 2022 23:16
Pokémon type weaknesses chart as JSON
{
"normal": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 2,
"poison": 1,
@teuffy
teuffy / nixos-mbp-dual-boot-instructions.txt
Created January 30, 2018 22:37 — forked from dmjio/nixos-mbp-dual-boot-instructions.txt
How to install nixos on a macbook pro dual boot (mid-2012 model)
Step 0: Download unetbootin and the latest nixos iso, put nixos iso onto unetbootin
Step 1: On OSX, Resize your OSX partition using disk utility (leave 25% - 75% as free space)
Step 2: Boot into NixOS from USB (hold down Alt-Option)
Step 3: Use fdisk to create 3 new partitions (nixosswap ~10GB, nixoshome ~75GB, nixosroot ~20GB)
Step 4: Init file systems / swaps
# mkfs.ext4 -L nixosroot /dev/sda4
# mkswap -L nixosswap /dev/sda5
# mkfs.ext4 -L nixoshome /dev/sda6
Step 5: Mount
# mount /dev/sda4 /mnt
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@titipata
titipata / caffe_install.md
Last active January 27, 2022 03:27
My notes on how to install caffe on Ubuntu

Caffe Installation

Note on how to install caffe on Ubuntu. Sucessfully install using CPU, more information for GPU see this link

###Installation

  • verify all the preinstallation according to CUDA guide e.g.
lspci | grep -i nvidia
@expandrive
expandrive / prettyjson
Created December 7, 2010 20:39
Take JSON from stdin and dump it to stdout in a more readable form
#!/usr/bin/python
# From http://stackoverflow.com/questions/352098/how-to-pretty-print-json-script
# To install paste this into a file named prettyjson that lives in your PATH
# e.g.
# sudo touch /usr/bin/prettyjson
# sudo open -t /usr/bin/prettyjson
# paste this file and save
# sudo chmod +x /usr/bin/prettyjson
"""
@phollyer
phollyer / spreadsheet_test
Created September 13, 2011 17:43
Spreadsheet Gem - updating an existing sheet without changing the output location or filename
#!/usr/bin/env ruby
require 'spreadsheet'
# Begin Test
print "Spreadsheet Test\n"
# Create the rows to be inserted
row_1 = ['A1', 'B1']
row_2 = ['A2', 'B2']