Skip to content

Instantly share code, notes, and snippets.

View Slackwise's full-sized avatar
🛸
Evangelizing Lisp

Adam Flanczewski Slackwise

🛸
Evangelizing Lisp
View GitHub Profile
@Slackwise
Slackwise / JavaScript Katamari Damacy
Created March 12, 2011 01:38
Paste into your address bar and enjoy!
javascript:var h='http://ec2-50-17-2-177.compute-1.amazonaws.com/js/',i,n,ss=['http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js',h+'Renderables.js',h+'Game.js'];for(i=0;i<ss.length;i++){n=document.createElement("script");n.src=ss[i]+'?'+Date.now();document.head.appendChild(n);}
@Slackwise
Slackwise / DateTime.parse_ad_format.rb
Created April 4, 2013 15:00
Active Directory keeps track of time in 100 NS intervals (UTC) since January 1st, 1601. Had to write this quick parsing method so I can work with AD exported data.
class DateTime
def self.parse_ad_format(datetime)
datetime = datetime.to_i
datetime /= 10_000_000 # Convert nanoseconds to seconds
datetime -= 11_644_473_600 # Get the difference between 1600 and 1970
strptime(datetime.to_s, '%s')
end
end
@Slackwise
Slackwise / seven.sh
Last active December 24, 2015 06:19
Setting up a Windows 7 VM using qemu-kvm. This is the script I use to run it.
#!/bin/sh
name="Seven"
hdd="./seven_hdd.img"
ram="2048"
cpu="host"
vga="std"
cdrom="./Win7-Pro-64.iso" # Must be an ISO file
# cdrom="virtio-win-0.1-65.iso"
@Slackwise
Slackwise / fix_minecraft.sh
Created October 11, 2013 23:07
Fix TechnicLauncher's copy of Minecraft which launches with a blank screen on Linux.
#!/bin/sh
libs=~/Minecraft/lwjgl-2.8.5
minecraft=~/.technic/tekkitmain/bin
cd $libs/jar
cp jinput.jar lwjgl.jar lwjgl_util.jar $minecraft
cd $libs/native/linux
cp *.so $minecraft/natives
@Slackwise
Slackwise / csv_to_json.rb
Created January 29, 2014 20:25
Converts a list of .csv files to .json files.
#!/usr/bin/env ruby
#
# Converts a list of .csv files to .json files.
require 'csv'
require 'json'
require 'pathname'
ARGV.each do |filename|
@Slackwise
Slackwise / force_time_sync_win.rb
Last active February 5, 2024 00:39
I hibernate my VMs at work when I'm done, and the time is always off. I can't just sync with w32tm because if I'm more than 24 hours off, it will refuse to sync.
require 'net/ntp' # gem install net-ntp
# Windows' date command expects MM/DD/YYYY, e.g. 5/15/2009
DATE_FORMAT = '%m/%d/%Y'
# Windows' time command expects HH:MM:SS AM/PM, e.g. 5:34:00 PM
TIME_FORMAT = '%I:%M:%S %p'
# External NTP is now firewalled :(
NTP_SERVER = 'MILLDATA'
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@Slackwise
Slackwise / fizzbuzz.clj
Created December 19, 2014 15:46
FizzBuzz in Clojure from an HN comment. (So clean!)
;; From https://news.ycombinator.com/item?id=8772229
(defn divisible? [x y]
(zero? (rem x y)))
(defn fizzbuzz [n]
(cond (divisible? n 15) "Fizzbuzz"
(divisible? n 3) "Fizz"
(divisible? n 5) "Buzz"
:else n))
@Slackwise
Slackwise / ricoh-login.js
Created January 2, 2015 15:56
This is from the login page for our Ricoh copier. (I wish I were joking.)
function encrypt() {
document.form1.userid.value = base64encode(document.form1.userid_work.value);
document.form1.password.value = base64encode(document.form1.password_work.value);
document.form1.userid_work.value = "";
document.form1.password_work.value = "";
}
@Slackwise
Slackwise / keybase.md
Created March 5, 2015 02:08
Verifying my GitHub identity for Keybase...

Keybase proof

I hereby claim:

  • I am Slackwise on github.
  • I am slackwise (https://keybase.io/slackwise) on keybase.
  • I have a public key whose fingerprint is 5F4F 28BF D807 A127 8C33 3600 A38C 998E 8324 CB8C

To claim this, I am signing this object: