Skip to content

Instantly share code, notes, and snippets.

@32bitkid
32bitkid / c-chord.bas
Last active August 30, 2021 22:35
Play a C-Chord on the OPL2 from QuickBasic.
DECLARE FUNCTION GetFNumFn% (block%, hz#)
DECLARE FUNCTION GetBlockNumFn% (hz#)
DECLARE SUB InitChannel (channel%)
DECLARE SUB EndNote (channel%)
DECLARE SUB PlayNote (channel%, hz#)
DECLARE SUB SetReg (Reg%, Value%)
CONST BaseAddr% = &H380
CLS : DEFINT A-Z
@32bitkid
32bitkid / cyo.css
Last active January 15, 2020 13:53
Choose Your Own... Markdown Extension.
@import '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css';
*[id^='cyo'],
*[id^='cyo'] ~ * {
display: none;
}
*[id^='cyo']:last-of-type ~ * {
display: block;
}
*[id^='cyo']:target ~ * {
display: block;
@32bitkid
32bitkid / tufteize-codepen.less
Last active April 7, 2018 15:17
Tufte style link/citations/asides for codepen.io blog posts.
.tufteize(@gutter, @gap) {
> p { margin-right: @gutter + @gap; }
.newthought { font-variant: small-caps; }
p>strong,
p>a:not([href^='#'])::before,
p>a[href^='#'] + * {
width: @gutter;
margin-right: -(@gutter + @gap);
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script>
<link href="http://code.jquery.com/qunit/qunit-git.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/qunit/qunit-git.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@32bitkid
32bitkid / MD5.as
Created May 8, 2012 17:46
Byte order fix for MD5
/*
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
@32bitkid
32bitkid / .profile
Created March 30, 2012 19:47
Basic git pairing utility.
# Sample .profile to display the current user/pair in the prompt (replacing user@machine in the prompt)
function git_user_name {
git config -z user.name
}
PS1='\[\033]0;$MSYSTEM:\w\007
\033[32m\]$(git_user_name) \[\033[33m\w$(__git_ps1)\033[0m\]
$ '
package {
import flash.display.MovieClip;
import flash.events.*;
public class Ball extends MovieClip {
private const speed:Number = 5;
private var yDir:Number;
private var xDir:Number;
#!/bin/bash
git log -1 --oneline | cut -d ' ' -f 1 | tee /dev/clipboard
function guidToArray(guid) {
tmp_guid = guid.replace(/-/g,"");
byteArray = new Array(tmp_guid.length/2);
for(var i = 0; i< tmp_guid.length; i+=2) { byteArray[i/2] = parseInt(tmp_guid.substr(i,2), 16) };
return byteArray;
}
Array.prototype.toGuid = function() {
a = [];
for(var i = 0; i < this.length; i++) { a[i] = (this[i] < 16) ? "0" + this[i].toString(16) : this[i].toString(16); }