Skip to content

Instantly share code, notes, and snippets.

@gavinmyers
gavinmyers / .bashrc
Last active December 11, 2015 04:18
default conf files, I didn't write most of these but I'm keeping them here as a reference for when I build a new machine.
alias tmux="TERM=screen-256color-bce tmux -2"
alias geany="sublime"
@gavinmyers
gavinmyers / cloo.clj
Last active December 27, 2022 10:45
Goop started in Clojure (currently just draws random pixel data, not optimized)
(import javax.swing.JFrame)
(import javax.swing.JPanel)
(import java.awt.event.ActionEvent)
(import java.awt.Dimension)
(import java.awt.Color)
(import javax.swing.Timer)
(import java.awt.event.ActionListener)
(import java.awt.event.KeyListener)
(import java.awt.image.BufferedImage)
(set! *warn-on-reflection* true)
@gavinmyers
gavinmyers / goop.c
Last active December 10, 2015 01:19
playing around, this is very broken
#include <GL/glut.h>
#define GOOP_WIDTH 1000
#define GOOP_HEIGHT 1000
static GLubyte GoopImage[GOOP_WIDTH][GOOP_HEIGHT][3];
void goop(void) {
int i, j, k;
for (i = 2; i < GOOP_HEIGHT-2; i++) {
for (j = 10; j < GOOP_WIDTH-25; j++) {
@gavinmyers
gavinmyers / goop.py
Created December 22, 2012 00:23
Initial port of Goop.java, not fully moved over and serious performance issues
#!/usr/bin/env python
import random
from pyglet.image import ImageData
from pyglet.window import *
w = 320
h = 320
window = pyglet.window.Window()
window.set_size(w,h)
img = pyglet.image.create(w,h)
@gavinmyers
gavinmyers / Goop.java
Created December 3, 2012 14:27
Goop (Java, BufferedImage)
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
public class Goop extends JPanel implements ActionListener {
private BufferedImage canvas;
@gavinmyers
gavinmyers / app.py
Created September 16, 2012 01:15
pyglet, simple window
#!/usr/bin/env python
from math import pi, sin, cos
from pyglet.gl import *
from pyglet.window import *
import pyglet
tile = 24
@gavinmyers
gavinmyers / main.coffee
Created July 27, 2012 14:41
REST, CoffeeScript, NodeJS, Redis
express = require "express"
crypto = require "crypto"
user = require "./src/user"
project = require "./src/project"
app = express.createServer()
app.listen 8008
app.get '/', (req, res) ->
res.write JSON.stringify {version:0.3}
res.end ""
@gavinmyers
gavinmyers / prime.rb
Created May 14, 2012 02:11
Prime Number Calculator in Ruby
#!/usr/bin/env ruby
puts "limit number:"
max = Integer(gets)
primes = []
puts "going from 2 to #{max}"
(2..max).select do |current|
# if current is divisible by any number in the array (that is not itself) it is not prime
isPrime = true
primes.each do |prime|
@gavinmyers
gavinmyers / 01.lisp
Last active October 4, 2015 20:07
Clojure, install and investigation
(defn random-letters [limit iteration]
(println (format "iteration: %s" iteration))
(println (format "limit: %s" limit))
)
(random-letters 25 5)
@gavinmyers
gavinmyers / FirstAttempt.java
Created May 14, 2012 02:03
Java Random Letters
package test;
public class Test {
private static String alphabet = "abcdefghijklmnopqrstuvwxyz";
public static void main(args[]) { //haven't written main in awhile... pretty sure this is wrong
int limit = 100; //hard coding since I dont remember how to work with args
int iteration = 3; //every third number
int count = iteratin;
for(int i = 0; i < limit; i++) {