Skip to content

Instantly share code, notes, and snippets.

@possan
possan / gltest.m
Last active August 29, 2015 14:16
Minimal self container OpenGL Example on OSX
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
@possan
possan / gltest.m
Created February 25, 2015 22:06
Minimal OpenGL Shader example
//
// Minimal self container OpenGL Example
//
// Compile with:
// xcrun gcc -o test -framework Foundation -framework OpenGL -framework CoreGraphics -framework AppKit main.m
//
#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <OpenGL/OpenGL.h>
@possan
possan / rotozoom.cob
Created August 19, 2015 22:25
VT100 Rotozoomer in Cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. ROTOZOOM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DUMMY PIC 9(1) BINARY VALUE 0.
01 FRAME PIC 9(10) VALUE 0.
01 WS-CNT PIC 9(3) VALUE 0.
01 WS-CNT2 PIC 9(3) VALUE 0.
01 TMP PIC 9(3) VALUE 0.
@possan
possan / dotstardisk-clcok.ino
Created September 3, 2015 21:40
A simple clock for the dotstar disk by adafruit https://www.adafruit.com/products/2477
#include <EEPROM.h>
#include <Adafruit_DotStar.h>
#include <SPI.h>
#include "TimerThree.h"
// R0 = 4x12 leds
// R1 = 4x11 leds
// R2 = 4x10 leds
// R3 = 4x9 leds
#include <dht11.h>
#include <MQ135.h>
// #include <Adafruit_NeoPixel.h>
// #include "FastLED.h"
#define DHT11_PIN 4
dht11 DHT;
MQ135 MQ(A0);
module tube(height, radius, wall, center = false) {
difference() {
cylinder(h=height, r=radius, center=center);
translate([0,0,-1]) cylinder(h=height + 2, r=radius- wall, center=center);
}
}
for(k=[0: 20.5: 300]) {
P = k / 300.0;
// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
const int MPU_addr=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
float avg_y;
float cur_y;
// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
#include <PID_v1.h>
const int MPU_addr=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
@possan
possan / .phoenix.js
Last active January 13, 2023 10:26
phoenix.js window manager configuration
//
// Phoenix configuration, updated 2023-01-13
//
// Use Cmd-Option-Command + Arrow keys to move/size windows, Cmd-Option-Command + Space for fullscreen
//
// Show debug logs: log stream --process Phoenix
//
var FULL = "full";
var FIRST = "0-1/3";
@possan
possan / prompt.sh
Last active April 17, 2017 14:20
Powerline prompt hack
#!/bin/sh
# Git logic stolen from https://github.com/twolfson/sexy-bash-prompt/blob/master/.bash_prompt
# Blocky fonts from https://github.com/powerline/fonts
# Colors from http://misc.flogisoft.com/bash/tip_colors_and_formatting
# http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
# magentas 236 24 247
# grn 34
# red 161