Skip to content

Instantly share code, notes, and snippets.

View armadillu's full-sized avatar

Oriol Ferrer Mesià armadillu

View GitHub Profile
@armadillu
armadillu / print256colours.sh
Created February 14, 2022 06:37 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@armadillu
armadillu / main.cpp
Created August 8, 2017 22:33
ofThread crash test
#include "ofApp.h"
int main() {
ofSetupOpenGL(1024, 768, OF_WINDOW);
ofRunApp(new ofApp());
}
@armadillu
armadillu / GLFW Joystick read
Last active August 29, 2015 14:14
glfw joystick access
vector<string> joys;
for(int j = 0; j < 5; j++){
bool joyOK = glfwJoystickPresent(j);
if(joyOK){
int n;
const float *data = glfwGetJoystickAxes(j, &n);
string thisj = string(glfwGetJoystickName(j)) + "\n axes\n";
//axes
for(int i = 0; i < n; i++){
{
"accession_number": "3.2013.1",
"active": true,
"applications": [
{
"id": "68765057",
"name": "Collections Table",
"slug": "collections-table"
}
],
ofImage img;
ofPBO pbo;
ofTexture pboTex;
void setup(){
//get some pixels from disk
img.setUseTexture(false); //no gpu upload
img.loadImage("crap8192.jpg");
@armadillu
armadillu / testApp.cpp
Created January 28, 2014 15:14
Delayed Texture load - over several frame - OpenGL
#include "testApp.h"
void testApp::setup(){
ofSetFrameRate(60);
ofSetVerticalSync(true);
ofBackground(22);
ofEnableAlphaBlending();
@armadillu
armadillu / copy-path-to-clipboard.scpt
Last active December 22, 2015 21:09 — forked from kitschpatrol/copy-path-to-clipboard.scpt
takes selected item from frontmost finder window, makes a smb:// link to the file and copies it into the clipboard Just go an paste it into your email! Whoever clicks on that link, will be automatically connected to that server and directed to that file. It also bypasses login window. Only for LP people!
-- csipttc_unisiwc_ctpttfwttc.app
-- Copy Selected Items Path To The Clipboard Unless Nothing Is Selected In Which Case Copy The Path To The Foremost Window To The Clipboard
on makeAndCopyLinkFromPath(myPath)
if myPath starts with "/Volumes/" then
set dirStructure to ((characters 9 thru -1 of myPath) as string)
set strHTML to quoted form of ("<a style='font-family:helvetica' href=\"smb://Guest::@lp-vault" & dirStructure & "\">" & myPath & "</a>") --double :: bc otherwise it disappears?
--tell application "Finder" to display dialog strHTML
do shell script "echo " & strHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
else
@armadillu
armadillu / makeOFAddonsSymbolicLinks.sh
Last active December 18, 2015 07:08
Make Symlinks from a random ofAddons directory into another directory. This script was done to solve this: http://forum.openframeworks.cc/index.php/topic,10966.msg49009.html#msg49009
@armadillu
armadillu / gist:2395589
Created April 16, 2012 00:37
IOS Font Names
(
"Thonburi-Bold",
Thonburi
)
2012-04-16 02:42:59.725 myApp[12412:707] (
"SnellRoundhand-Bold",
"SnellRoundhand-Black",
SnellRoundhand
)
2012-04-16 02:42:59.729 myApp[12412:707] (
@armadillu
armadillu / gist:2366924
Created April 12, 2012 12:31
recursive .svn dir delete
find . -type d -name .svn -print0 | xargs -0 rm -rf