Skip to content

Instantly share code, notes, and snippets.

@dcat
dcat / tile.xbm
Created October 30, 2014 15:02
tile.xbm
#define tile_width 56
#define tile_height 32
static unsigned char tile_bits[] = {
0x01, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x06, 0x40, 0x20, 0x10, 0x08,
0x04, 0xc0, 0x18, 0x40, 0x20, 0x10, 0x08, 0x04, 0x30, 0x60, 0x40, 0x20,
0x10, 0x08, 0x04, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0xe0,
0x43, 0x18, 0x10, 0x30, 0x84, 0x0f, 0x98, 0x4c, 0x06, 0x10, 0xc0, 0x64,
0x32, 0x86, 0xf0, 0x01, 0x10, 0x00, 0x1f, 0xc2, 0x81, 0x70, 0x00, 0x10,
0x00, 0x0c, 0x02, 0x81, 0x08, 0x00, 0x6c, 0x00, 0x18, 0x02, 0x81, 0x04,
0x00, 0x83, 0x01, 0x60, 0x02, 0x81, 0x03, 0xc0, 0x00, 0x06, 0x80, 0x03,
@cmlsharp
cmlsharp / !!
Last active November 26, 2019 11:57
Repeat most recent command in fish
# Add this to your ~/.config/fish/config.fish
# Syntax:
# To just rerun your last command, simply type '!!'
# '!! sudo' will prepend sudo to your most recent command
# Running !! with anything other than sudo will append the argument to your most recent command
# To add another command to prepend list remove the # on line 10 and put the command in the quotes. Repeat as needed
function !!;
set prevcmd (history | head -n 1)
if test "$argv"
if test "$argv" = "sudo" #; or "any other command you want to prepend"
/* TinyWM is written by Nick Welch <mack@incise.org>, 2005.
* TinyWM-XCB is rewritten by Ping-Hsun Chen <penkia@gmail.com>, 2010
*
* This software is in the public domain
* and is provided AS IS, with NO WARRANTY. */
#include <xcb/xcb.h>
int main (int argc, char **argv)
{
@clohr
clohr / sets.js
Created February 26, 2017 19:09
ES6 Sets: Intersection, Difference, and Union
const a = new Set([1, 2, 3, 4, 4, 4])
const b = new Set([3, 4, 5, 6])
const intersect = (set1, set2) => [...set1].filter(num => set2.has(num))
const differ = (set1, set2) => [...set1].filter(num => !set2.has(num))
const joinSet = (set1, set2) => [...set1, ...set2]
const myIntersectedSet = new Set(intersect(a, b))
console.log('myIntersectedSet', myIntersectedSet)
@balupton
balupton / LINUX.md
Last active May 27, 2022 10:22
New Machine Start Kit

Linux

Setup

# If inside vmware install vmware tools (these are just as good as the commercial ones)
sudo apt-get install open-vm-tools open-vm-tools-desktop

# Install git
sudo apt-get install git
@jjcomer
jjcomer / ants.clj
Created December 18, 2011 18:22
Ant Simulation -- From Clojure Concurrency Presentation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
; which can be found in the file CPL.TXT at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
;As shown in the presentation: http://blip.tv/clojure/clojure-concurrency-819147
@mranney
mranney / emoji_sad.txt
Created January 30, 2012 23:05
Why we can't process Emoji anymore
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@gmccreight
gmccreight / master.vim
Last active September 23, 2023 08:41
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE