Skip to content

Instantly share code, notes, and snippets.

View companje's full-sized avatar

Rick Companje companje

View GitHub Profile
@companje
companje / thermalprinter.ino
Created November 23, 2014 21:13
Thermal printer markup code for Arduino
#include <SD.h>
void setup() {
Serial.begin(19200);
pinMode(10, OUTPUT);
if (!SD.begin(10)) {
Serial.println("Card failed, or not present");
return;
}
@companje
companje / gsnake.asm
Created November 23, 2014 21:28
Graphical snake game in assembly
code Segment para public 'code'
assume cs:code,ds:code,es:code
locals ; remove if you want to assemble
jumps ; with Masm
.386
org 100h
YES equ 1
NO equ 0
@companje
companje / spotify.sh
Created November 30, 2014 20:29
shell script to request Spotify track ID for a song or a whole playlist
function spotify() {
count=$[$count+1]
id=`curl --silent -G --data-urlencode "q=$1" "https://api.spotify.com/v1/search?&type=artist,track" -H "Accept: application/json" |
grep "spotify:track:" |
head -n 1 |
cut -c 16-51`
if [ -z "$id" ] ; then
>&2 echo -e "\033[0;31m$1\033[0m"
@companje
companje / gallery.js
Last active August 29, 2015 14:19
Siene's photo gallery using PhotoSwipe
@companje
companje / LSystem-3gen.stl
Created August 17, 2015 07:41
LSystem-3gen.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@companje
companje / doodle3d-client.js
Last active September 22, 2015 14:47
Doodle3D client javascript version 0.10.7 with modification on line 4473 to enable traveling on first two layers
/*
* This file is part of the Doodle3D project (http://doodle3d.com).
*
* Copyright (c) 2013, Doodle3D
* This software is licensed under the terms of the GNU GPL v2 or later.
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
*/
function ConfigAPI() {
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofSetFrameRate(60); //limit framerate to 60
ofSetBackgroundAuto(false); //turn off automatic background clearing
ofEnableAlphaBlending(); //enable transparency
ofBackground(0); //set background to black
ball.x = 100; //initial position for ball
//////////// testApp.h
#pragma once
#include "ofMain.h"
class Ball {
public:
ofPoint pos; //it's better to use ofVec3f instead of ofPoint
ofPoint vel;
#pragma once
#include "ofMain.h"
#define NUM 100
class Ball {
public:
ofPoint pos; //it's better to use ofVec3f instead of ofPoint
ofPoint vel;
///////////////////////////////////////////////
#pragma once
#include "ofMain.h"
class testApp : public ofBaseApp{
public:
void setup();
void update();