Skip to content

Instantly share code, notes, and snippets.

@orangecms
orangecms / 9boot.log
Created July 22, 2021 19:19
9legacy boot
spawn qemu-system-x86_64 -machine accel=kvm -nographic -m 1024 -vga none -net user -net nic,model=virtio -device virtio-scsi-pci,id=scsi -cdrom plan9-gce.iso -boot d
c[?7lSeaBIOS (version ArchLinux 1.14.0-1)
iPXE (http://ipxe.org) 00:02.0 C000 PCI2.10 PnP PMM+3FF914D0+3FEF14D0 C000
Press Ctrl-B to configure iPXE (PCI 00:02.0)...
@TRPB
TRPB / arch-macbook2018.md
Last active November 20, 2023 13:21
Guide: Running Arch on a 2018 MacBook Pro

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@turowicz
turowicz / swift-json-class.md
Last active February 21, 2017 07:00
Apple Swift strong type object serialization to JSON
@icholy
icholy / gobreak.sh
Last active December 16, 2015 19:18
Shell script to simplify setting GDB breakpoints
# Demo http://ascii.io/a/3019
# build
gdbb () {
# build with debug flags
go build -gcflags "-N -l" -o out
# make sure the build didn't fail
if [ $? != 0 ]; then return; fi
@pmarreck
pmarreck / ruby_email_rfc_5322_regexp.rb
Last active February 15, 2022 21:17
RFC 5322 Email Validation Regex in Ruby Regular Expressions
# RFC 5322 Email Validation Regex in Ruby
# This work is released under the BSD 3-Clause License
# http://choosealicense.com/licenses/bsd-3-clause/
# Copyleft (ɔ) 2013, Peter R. Marreck
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
@femto113
femto113 / transpose.js
Last active September 6, 2023 00:28
one line transpose for 2-dimensional Javascript arrays
function transpose(a)
{
return a[0].map(function (_, c) { return a.map(function (r) { return r[c]; }); });
// or in more modern dialect
// return a[0].map((_, c) => a.map(r => r[c]));
}
@zearen
zearen / JSONParser.hs
Created January 28, 2012 04:00
A simple haskell demonstation showing parsing JSON with Parsec
{-
Zachary Weaver <zaw6@pitt.edu>
JSONParser.hs
Version 0.1.1
A simple example of parsing JSON with Parsec in haskell. Note that
since the primary point of this excersize is demonstration,
Text.Parsec.Token was avoided to expose more of the grammar. Also,
complicated optimizations and shorcuts were avoided (mostly).
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)