Skip to content

Instantly share code, notes, and snippets.

@3demax
3demax / tabbar-tweak.el
Created October 5, 2011 14:58
Emacs tabbar-mode visual tweaks
;; This are setting for nice tabbar items
;; to have an idea of what it looks like http://imgur.com/b0SNN
;; inspired by Amit Patel screenshot http://www.emacswiki.org/pics/static/NyanModeWithCustomBackground.png
;; Tabbar
(require 'tabbar)
;; Tabbar settings
(set-face-attribute
'tabbar-default nil
:background "gray20"
@rtgibbons
rtgibbons / VBoxReloadKext.sh
Created March 12, 2012 19:51 — forked from timdream/VBoxReloadKext.sh
Script: reload VirtualBox kernel extension in Mac OS X
#!/bin/bash
unload() {
kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}
load() {
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@viktorklang
viktorklang / minscalaactors.scala
Last active March 25, 2024 19:01
Minimalist Scala Actors
/*
Copyright 2012-2021 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@tonymorris
tonymorris / gist:5367920
Created April 11, 2013 23:03
The z in scalaz
The z in scalaz means this: it was early 2008 and I was working for a Java consultancy and so of course, I used the most appropriate tool for the job: scala. But it had *terrible* libraries, so I offered to fix those while also meeting my other objectives. Turns out that the Scala guys were extremely hostile to even half-decent libraries (and still are to this day). I still struggle to wrap my head around this sometimes.
Anyway, so I thought, well fuck it, I will just keep them to myself for now. My (awesome) employer had already agreed that we'd probably open-source such a thing, but I was concerned most about my primary goal. So then it came time to "name" this library. I had named it "scalax" simply so that I did not have the inclination to think of a proper name. Then I found out that such a library was being developed and with my internal name! Whatever, I thought.
So I looked at this scalax library, hoping that I could just abandon my efforts and jump on board with everyone else -- they too had figure
@willurd
willurd / web-servers.md
Last active June 7, 2024 03:53
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@paracycle
paracycle / convert.sql
Created July 29, 2013 19:50
Convert and merge WhatsApp databases from iPhone format to Android
-- Clear tables
DROP TABLE chat_list;
DROP TABLE messages;
-- Create new tables
CREATE TABLE chat_list (_id INTEGER PRIMARY KEY AUTOINCREMENT, key_remote_jid TEXT UNIQUE, message_table_id INTEGER);
CREATE TABLE messages (_id INTEGER PRIMARY KEY AUTOINCREMENT, key_remote_jid TEXT NOT NULL, key_from_me INTEGER, key_id TEXT NOT NULL, status INTEGER, needs_push INTEGER, data TEXT, timestamp INTEGER, media_url TEXT, media_mime_type TEXT, media_wa_type TEXT, media_size INTEGER, media_name TEXT, latitude REAL, longitude REAL, thumb_image TEXT, remote_resource TEXT, received_timestamp INTEGER, send_timestamp INTEGER, receipt_server_timestamp INTEGER, receipt_device_timestamp INTEGER, raw_data BLOB, media_hash TEXT, recipient_count INTEGER, media_duration INTEGER, origin INTEGER);
-- Attach Android and iPhone databases
ATTACH 'msgstore.db' AS android;
@forax
forax / gist:e733e6af6114eff55149
Created June 1, 2014 16:13
Lispy interpreter written in Java
import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toCollection;
import static java.util.stream.Collectors.toList;
import static java.util.stream.IntStream.range;
import static java.util.stream.Stream.concat;
import static java.util.stream.Stream.of;
import java.io.Console;
@jrandom
jrandom / Pool.h
Last active December 27, 2021 23:54
C++11/14 Thread Pool
//
// Pool.h
//
#ifndef Tools_Thread_Pool_h
#define Tools_Thread_Pool_h
// ================================================================================ Standard Includes
// Standard Includes