View btcbal.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import getopt | |
import urllib2 | |
from optparse import OptionParser | |
def main(): | |
# variables | |
btcaddr = "" |
View pizzaoven.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to compute optimal dimensions for a pizza oven given a fixed door width and flue pipe area | |
// For example, a door to accept a 12" pizza and an 8" flue pipe | |
function pizzaOven(doorWidth, flueDiameter) { | |
let doorHeight = flueDiameter / (doorWidth * 0.1); // flue is 10% the area of the door | |
let domeWidth = doorWidth * 2; // door is ~50% the width of the dome | |
let domeHeight = (doorWidth / 63) * 100; // door is ~63% the height of the dome | |
return { | |
dome: { | |
width: domeWidth.toFixed(2), |
View atof.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Onlu needed for printf() */ | |
#include <stdio.h> | |
/* Boolean types - comment if not needed */ | |
typedef int bool; | |
#define true 1 | |
#define false 0 | |
/* !Boolean types */ | |
/* There are also built-in functions for these */ |
View compactBits.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MAX_PRECISION = 28; | |
function _findExp (n, base, exp = 1) { | |
var pow = Math.pow(base, exp); | |
var div = Math.floor(n / pow); | |
if (exp > MAX_PRECISION) { | |
return div; | |
} | |
return div + _findExp(n, base, exp + 1); | |
} |
View yurt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const defaults = { | |
units: 'ft', // units to use, could be 'ft' or 'm' | |
diameter: 14, // units | |
wallHeight: 6, // units, at outer edge | |
khanaHoleSpacing: 1, // units, spacing between crossing rods | |
roofAngle: 25, // degrees from horizontal | |
tonoDiameter: 1, // units | |
} | |
function deg2rad(deg) { |
View lukecaster.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>LukeCaster</title> | |
<script type="text/javascript" src="raycaster.js"></script> | |
<style type="text/css"> | |
body { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; |
View chats-with-messages.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<title>Chats</title> | |
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400&display=swap" rel="stylesheet"> | |
<style type="text/css"> | |
:root { |
View queue.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Luke Mitchell & Max Peglar-Willis, 2020 | |
// <hi@lukemitchell.co> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include "queue.h" | |
// Initialise a new queue of the | |
// specified size |
View mix.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Colour Swatch Mixing</title> | |
<style> | |
.container { | |
display: flex; | |
} | |
.container div { | |
width: 100px; |
View colour.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to generate a 24-bit (non-alpha) colour (color, for US English speakers) | |
function makeRandomColour() { | |
const MAX_INT24 = 16777215; | |
return '#' + Math.round(Math.random() * MAX_INT24).toString(16); | |
} |
NewerOlder