Skip to content

Instantly share code, notes, and snippets.

Avatar
💰
absconding with my hoard

Conor O'Brien ConorOBrien-Foxx

💰
absconding with my hoard
View GitHub Profile
@ConorOBrien-Foxx
ConorOBrien-Foxx / koch.ps
Created Dec 12, 2017
Koch Snowflake in PostScript
View koch.ps
% yes, I really did implement a turtle for this.
%-- turtle functions --%
% CONSTANTS
/T-Angle 0 def
/T-Drawing true def
/T-coorfromangle {
dup T-Angle cos mul exch T-Angle sin mul
} def
View 4.rb
$ops = %w(add subtract multiply divide exit print set input loop end)
def getchar
res = STDIN.getc.ord rescue 0
end
class Numeric
def call prog
return unless self == 4
unless prog = prog.delete(' ')[/\A3\.(\d*)4\z/, 1]
View Main.java
import java.util.Scanner;
public class Main {
public static String convert(String name) {
String head = "" + name.charAt(0);
head = head.toUpperCase() + name.substring(1).toLowerCase();
return head;
}
public static void swap(String[] array, int i, int j) {
View hw.yup
0e00e-0e00e----|00e00e--|00e00e00e----|00e00e00e----|--e|--e|--e@0e0e00e--00e00e----|00e00e00e--|00e00e--|--e--|--e|000e-0e00e--00e00e-----|--e-@0e00e-0e00e----|00e00e00e----|00e00e00e----|00e00e00e----|--e|--e|--e:@@0e00e00e----|00e00e00e----|--e|00e00e--00e00e----|00e00e00e----|--e|--e00e-0e-0e--@0e00e-0e00e----|00e00e00e----|00e00e00e----|--e00e-0e--|--e@0e00e-0e00e----|00e00e--|00e00e--00e00e----|--e|--e:@00e-0e-0e-|00e0e00e00e--|00e00e--|--e--|00e00e--00e00e--|00e00e--|--e--|--e-|--e@0e00e00e----|00e00e00e----|--e|00e00e--00e00e----|00e00e00e----|--e|--e00e-0e-0e--@0e00e--|00e00e00e----|--e|00e00e--00e00e----|00e00e00e--|00e00e--|--e--|--e0e-|--e@0e00e-0e00e----|00e00e00e----|00e00e00e----|00e00e00e----|--e|--e|--e@0e00e-0e00e----|00e00e00e--00e00e------|00e00e00e--00e00e------|--e|--e@00e--@
View milliseconds.h
#ifndef INCLUDE_MILLISECONDS
#define INCLUDE_MILLISECONDS
#include <time.h>
#ifdef __WIN32
#include <windows.h>
#define M_OS_WINDOWS
#else
#include <sys/time.h>
#define M_OS_SANE
#endif
View asdf.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
typedef struct operator {
char* name;
int prec;
} operator;
View math.min.js
/**
* math.js
* https://github.com/josdejong/mathjs
*
* Math.js is an extensive math library for JavaScript and Node.js,
* It features real and complex numbers, units, matrices, a large set of
* mathematical functions, and a flexible expression parser.
*
* @version 2.5.0
* @date 2015-12-05
@ConorOBrien-Foxx
ConorOBrien-Foxx / bf.rb
Last active Jul 30, 2017
Ruby BF compiler
View bf.rb
preamble = <<'EOF'
#include <stdint.h>
#include <stdio.h>
int main(){
#define S 65536
uint8_t t[S] = {0};
uint8_t m[S] = {0};
uint16_t p = 0, f = 0, z = 0;
int i, q = 0, d = 0, g = 0;
View languages-graph.txt
// test it at www.webgraphviz.com/
digraph languages {
// esolangs
node [
color = darkorchid1
style = filled
]; Pyth Jelly Japt Jolf GolfScript CJam Actually Seriously "Arcyóu" V Brainfuck Braingolf Simplex Element GS2 MATL Befunge "><\>" Minkolang "O" "05AB1E" Ohm
node [
color = black
style = outline
@ConorOBrien-Foxx
ConorOBrien-Foxx / golf.rb
Created May 6, 2017
Extensible metagolfer
View golf.rb
"
double: <<>
parity swap: ::^~<~^
"
class Transformation
def initialize(sym, inv)
@sym = sym
@inv = inv
end