This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iaroc.ios; | |
import java.net.DatagramSocket; | |
import java.net.DatagramPacket; | |
/* | |
* iOSAccelerometerReceiver: Class that handles a UDP connection to an | |
* iOS device and parses the data for accelerometer data. | |
* | |
* @author gerberduffy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Find move all mp4 movies in a directory to an external drive/folder, than delete all large files | |
LARGE_FILE_SIZE=500 ##in MB | |
START_DIR=$HOME | |
EXTERN_DIR=/Volumes/Extern/movies | |
find $START_DIR -type f -name "*.mp4" -exec mv {} $EXTERN_DIR ';' | |
find $START_DIR -type f -size +${LARGE_FILE_SIZE}M -exec rm {} ';' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define SIZE 128 //If you have an input image that is NxN, SIZE = N. | |
//Adjust to suit your needs. | |
int main(int argc, char* argv[]){ | |
FILE* imageA = fopen(argv[1], "rb"); //Input image 1 (filename read from argv[1]) | |
FILE* imageB = fopen(argv[2], "rb"); //Input image 2 (filename read from argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>Cube Testing</title></head> | |
<body> | |
<?php | |
/** | |
* | |
Author: Andrew Duffy | |
test.php: Take the sum of two floating-point images | |
stored in binary files on S3 whose URLs are to be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -Rv root /var/www | |
sudo chgrp -Rv www-data /var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void InitShading(){ | |
//Fragment shader we want to use | |
GLuint oddRowShaderId = glCreateShader(GL_FRAGMENT_SHADER); | |
std::cout << "Creating the fragment shader with id " << oddRowShaderId << std::endl; | |
const GLchar *source = | |
"void main(){" | |
" if (mod(gl_FragCoord.y-0.5, 2.0) == 1.0){" | |
" gl_FragColor = gl_Color;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdio.h> | |
//This is nice: http://stackoverflow.com/questions/3907818/opengl-headers-for-os-x-linux | |
//OS X headers | |
#ifdef __APPLE__ | |
#include <OpenGL/gl.h> | |
#include <OpenGL/glu.h> | |
#include <GLUT/glut.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Written by Andrew Duffy, December 2015 | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
from subprocess import Popen, PIPE | |
SCRIPT_TEXT = b""" | |
<script type="text/javascript"> | |
setTimeout(function() { location.reload() }, 5000) | |
</script> | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Title: osx-notify-mention.pl | |
# Author: Andrew Duffy <[email protected]> | |
# Descrption: A no-deps irssi script that sends desktop notifications on OSX | |
# when a message comes into a channel you've joined that mentions | |
# your nick. | |
# | |
use strict; | |
use Irssi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
server { | |
listen 80; | |
server_name aduffy.org; |
OlderNewer