Skip to content

Instantly share code, notes, and snippets.

@robmint
robmint / inform7-cheatsheet.md
Last active September 30, 2023 01:47
Inform 7 cheatsheet

Global values - values that vary

Start is a room. "You are at the start of the game. [if the era is the past] In the past[otherwise] In the present[end if]."
The time machine is a thing in the start.
Instead of examining the time machine:
	say "You feel your mind drifting...";
	now the era is the past.

Openable things that change when you open them

@robmint
robmint / cat.js
Created May 31, 2022 05:34
cat javascript for Luna
function Cat() { // cat factory, called a Constructor
this.furry = true; // this is the info that every cat has to start with
this.name = ""; // but can be changed
this.legs = 4;
}
cat = []; // make a new list of cats: [] means a numbered list starting at 0
for(var i=0; i<5; i++) { // go through the list creating 5 cats
cat[i] = new Cat(); // use the Cat() factory to make a new cat and store it in the list of cats
}
@robmint
robmint / gist:4753401
Last active May 18, 2020 10:48
Basic linux framebuffer graphics setup
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <linux/input.h>
@robmint
robmint / pagination.php
Last active October 29, 2019 11:14
Pagination like flickr, digg, github - the standard pagination pattern
<?php
// based on the work of Jason Coleman
// http://www.strangerstudios.com/blog/2006/07/paginate-your-site-like-digg/
/* The pagination function simply spits out a data structure
that you can render any way you like.
See also the javascript version for node:
https://gist.github.com/robmint/4651cf1c6f336e663dba
*/

Keybase proof

I hereby claim:

  • I am robmint on github.
  • I am vdu23 (https://keybase.io/vdu23) on keybase.
  • I have a public key ASD-ozCiOx9vjli7JZRMU9UqiRfUAbfbJUSrATpy5BfZiwo

To claim this, I am signing this object:

@robmint
robmint / raygun2curl.rb
Last active June 13, 2016 22:16
Parse RayGun raw json data into a curl command
#!/usr/bin/env ruby -w
require 'rubygems'
require 'json'
#local = "localhost:3000"
local = false
json = File.read(ARGV[0])
obj = JSON.parse(json)
Verifying that +robcarter is my blockchain ID. https://onename.com/robcarter
@robmint
robmint / nzbcx-private-api-call.php
Created June 5, 2016 00:22
Connect to the NZBCX bitcoin exchange via private API call
$key = ''; // fill in these details
$secret = '';
$id = '';
// Nonce of the current Unix timestamp string encoded
$nonce = strval(time());
$sigtext = $nonce . $id . $key;
$signature = hash_hmac ('sha256',$sigtext,$secret);
@robmint
robmint / git-cheatsheet.md
Last active June 1, 2016 21:44
Git cheatsheet

Show branches still to be merged to master

git fetch
git branch --no-merged master

Create new branch and switch to it

@robmint
robmint / messages.rb
Last active May 9, 2016 01:38
ruby singleton pattern
require 'yaml'
module Valet
class Messages
@messages ||= YAML::load_file(File.expand_path('../../../messages.yml', __FILE__))
def self.text(key)
@messages[key]['text']
end