Skip to content

Instantly share code, notes, and snippets.

View ryandhubbard's full-sized avatar

Ryan Hubbard ryandhubbard

  • Planet Art
  • Los Angeles
View GitHub Profile
@ryandhubbard
ryandhubbard / Maze - input.csv
Created August 16, 2016 22:01
Recursive Maze Solver
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
3 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0
4 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0
5 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0
6 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 1 1 0
7 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0
8 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0
9 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0
@ryandhubbard
ryandhubbard / Rotate-13
Created August 17, 2016 16:31
assembly Rotate-13 encrypter
@@@ OPEN INPUT FILE, READ INTEGER FROM FILE, PRINT IT, CLOSE INPUT FILE
.equ SWI_Open, 0x66 @open a file
.equ SWI_Close,0x68 @close a file
.equ SWI_PrChr,0x00 @ Write an ASCII char to Stdout
.equ SWI_PrStr, 0x69 @ Write a null-ending string
.equ SWI_PrInt,0x6b @ Write an Integer
.equ SWI_RdInt,0x6c @ Read an Integer from a file
.equ Stdout, 1 @ Set output target to be Stdout
.equ SWI_Exit, 0x11 @ Stop execution
.global _start
@ryandhubbard
ryandhubbard / integer-sort.s
Created August 17, 2016 16:33
ARM7 assembly program Sort integers
@@@ OPEN INPUT FILE, READ INTEGER FROM FILE, PRINT IT, CLOSE INPUT FILE
.equ SWI_Open, 0x66 @open a file
.equ SWI_Close,0x68 @close a file
.equ SWI_PrChr,0x00 @ Write an ASCII char to Stdout
.equ SWI_PrStr, 0x69 @ Write a null-ending string
.equ SWI_PrInt,0x6b @ Write an Integer
.equ SWI_RdInt,0x6c @ Read an Integer from a file
.equ Stdout, 1 @ Set output target to be Stdout
.equ SWI_Exit, 0x11 @ Stop execution
.global _start
@ryandhubbard
ryandhubbard / locker-controller
Created August 17, 2016 16:34
arm assembly lock control system
.equ SEG_A,0x80
.equ SEG_B,0x40
.equ SEG_C,0x20
.equ SEG_D,0x08
.equ SEG_E,0x04
.equ SEG_F,0x02
.equ SEG_G,0x01
.equ SEG_P,0x10
.global _start
.text
@ryandhubbard
ryandhubbard / KnowledgeTree.java
Created August 18, 2016 22:45
Java KnowledgeTree
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class KnowledgeTree {
private String topicofthegame;
private Node treebase;
public KnowledgeTree(BufferedReader file) throws IOException {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Meta Lab</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="icon" href="assets/images/favicon.png" sizes="16x16">
<style id="jsbin-css">
td {
@ryandhubbard
ryandhubbard / CW_contact_revision.js
Last active February 24, 2020 20:25
A revision to Bhubbards gist
const ConnectWiseRest = require('connectwise-rest');
const cw = new ConnectWiseRest({
companyId: process.env.CONNECTWISE_COMPANY_ID,
companyUrl: process.env.CONNETWISE_COMPANY_URL,
publicKey: process.env.CONNECTWISE_PUBLIC_KEY,
privateKey: process.env.CONNECTWISE_PRIVATE_KEY,
clientId: process.env.CONNETWISE_CLIENT_ID,
entryPoint: 'v4_6_release', // optional, defaults to 'v4_6_release'
timeout: 20000, // optional, request connection timeout in ms, defaults to 20000
@ryandhubbard
ryandhubbard / bucket_value.sql
Last active December 6, 2022 16:14
Bucket Value
SELECT COUNT(1) AS total
, CASE
WHEN measure <= 0 THEN '0-10'
WHEN measure <= 100 THEN CONCAT(CEIL(measure/10)*10-10,'-',CEIL(measure/10)*10)
WHEN measure <= 30000 THEN CONCAT(CEIL(measure/50)*50-50,'-',CEIL(measure/50)*50)
WHEN measure > 30000 THEN 'over 30000'
ELSE NULL
END AS bucket
, CASE
WHEN measure <= 100 THEN CEIL(measure/10)*10
from PIL import Image, ImageDraw, ImageFont
import random
def create_puzzle():
base = 3
side = base*base
# pattern for a baseline valid solution
def pattern(r,c): return (base*(r%base)+r//base+c)%side