Skip to content

Instantly share code, notes, and snippets.

View kzar's full-sized avatar
🐈
Bashing the rocks together...

Dave Vandyke kzar

🐈
Bashing the rocks together...
View GitHub Profile
@kzar
kzar / log-blob.js
Last active February 20, 2024 02:53
Log chrome webRequest and webNavigation events for blob URLs
function logEvent(type, details)
{
if (details.url.startsWith("blob"))
console.log(type, details);
}
/* WebNavigation */
chrome.webNavigation.onBeforeNavigate.addListener(details =>
{
logEvent("onBeforeNavigate", details);
@kzar
kzar / dwarf-fortress-ubuntu-installation-instructions.sh
Last active December 8, 2022 05:08
Dwarf Fortress Linux (Ubuntu 15.04) installation instructions. (Nice graphics but no other crap!)
# Install a bunch of dependencies (Might not be everything, sorry!)
sudo apt-get install libsdl1.2debian:i386 libsdl-image1.2:i386\
libsdl-ttf2.0-0:i386 libglu1-mesa:i386 libgtk2.0-0:i386\
libopenal1:i386 libjpeg62:i386 git tar unzip bzip2
# Fetch Dwarf fortress itself (See http://www.bay12games.com/dwarves/ )
mkdir dwarf-fortress && cd dwarf-fortress
wget http://www.bay12games.com/dwarves/df_42_06_linux.tar.bz2
tar xvjf df_42_06_linux.tar.bz2
@kzar
kzar / Instructions.md
Last active December 2, 2021 03:39
My Thinkpad T450 Ubuntu set up

Ubuntu 15.04 (Vivid) has now been released and it fixes mostly all of the issues I had with my Thinkpad T450. I recommend doing a clean install of Ubuntu 15.04 and mostly avoiding all of the steps bellow!

My process for getting Ubuntu running really nicely on a Thinkpad T450 with all the hardware working. (I have my track pad disabled in the bios and only want to use the track point.)

Basic steps to get Ubuntu running nicely on the Thinkpad T450:

@kzar
kzar / workaround.py
Created August 11, 2015 09:55
line_profiler Python "NameError: name 'profile' is not defined" workaround
import line_profiler
profile = line_profiler.LineProfiler()
@kzar
kzar / curry.py
Created August 18, 2015 13:14
Very simple example of how you could curry functions in Python using lambda
def example(a, b, c):
return (a, b, c)
curried1 = lambda b, c: example(1, b, c)
curried2 = lambda *args: example(1, *args)
@kzar
kzar / tetris.rb
Created December 16, 2010 16:19
Tetris in Ruby (Dave's first Ruby program)
#!/usr/bin/env ruby
# Dave's Tetris clone, Dave Barker 2010
# (Requires rubygame, rsdl, sdl, sdl_graphics, sdl_ttf and ruby >= 1.9)
# (Make sure you put Chalkduster.ttf if working directory)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@kzar
kzar / notification-tests-developer.js
Last active December 2, 2019 12:17
Testing Adblock Plus for Chrome notifications
/**
* 1. Append one of these blocks to adblockpluschrome/lib/devtools.js...
*/
// Desktop notification, relentless type, no links
require("notifications").notifications.addNotification({
id: (new Date() | 0).toString(),
type: "relentless",
title: "Notification title",
message: "Notification message"
@kzar
kzar / trac-spam-comments.json
Last active October 8, 2019 19:45
Spam comments on issues.adblockplus.org grouped by user
{
"sheweed168": [
"https:\/\/issues.adblockplus.org\/ticket\/536#comment:20"
],
"impulsepp": [
"https:\/\/issues.adblockplus.org\/ticket\/536#comment:19",
"https:\/\/issues.adblockplus.org\/ticket\/2501#comment:6",
"https:\/\/issues.adblockplus.org\/ticket\/1460#comment:26",
"https:\/\/issues.adblockplus.org\/ticket\/1095#comment:6",
"https:\/\/issues.adblockplus.org\/ticket\/553#comment:26",
@kzar
kzar / adblockplus-issue-trackers.md
Created September 12, 2019 15:38
Old issues.adblockplus.org issue tracker module to new issue tracker(s) table
@kzar
kzar / edgeIDBtest.js
Created January 23, 2019 12:11
Edge extension IndexedDB test (7223)
function openDB(dbName)
{
let req = indexedDB.open(dbName);
req.onsuccess = event =>
{
console.log("version::", event.currentTarget.result.version);
console.log("store names::", JSON.stringify(event.currentTarget.result.objectStoreNames));
};