Skip to content

Instantly share code, notes, and snippets.

View dimitre's full-sized avatar
💭
💾

Dimitre dimitre

💭
💾
View GitHub Profile
@RubeRad
RubeRad / txt2tff.pl
Created February 25, 2011 17:45
Read in nrows,ncols, followed by nrows lines of ncols whitespace-separated pixel intensities. Output .tff
#! /bin/perl
# txt2tff.pl
use Getopt::Std;
$opt{x} = 1;
getopts('x:o:', \%opt);
# determine the dimensions, create an empty 2D matrix
$_ = <>;
@phpdude
phpdude / nginx.conf
Last active February 28, 2024 04:36
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@admsyn
admsyn / README.txt
Created November 24, 2012 15:45
Keep an installation alive with launchd & launchctl
Add this .plist to ~/Library/LaunchAgents to have it automatically
take effect whenever you log in. It will continue to be active until
you log out (even if you delete the file).
You can take manual control over it instead by putting the file
anywhere else, then using launchctl like this:
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
launchctl load path/to/the/plist/com.admsyn.keep-twitter-alive.plist
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
@acarabott
acarabott / buildAndRun.sh
Last active October 12, 2016 20:50
openFrameworks Sublime Text Build
#!/bin/bash
# This lives in your project directory, alongside src/, bin/, config.make, etc
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
make Debug && make RunDebug;
@magnetikonline
magnetikonline / README.md
Last active July 7, 2024 05:27
Setting Nginx FastCGI response buffer sizes.
@gavinhungry
gavinhungry / nginx-tls.conf
Last active July 18, 2024 11:35
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@SheffieldKevin
SheffieldKevin / MICMSampleBuffer.h
Last active January 18, 2024 10:14
Video Sample buffer accessor/iterator using AVFoundation
// MICMSampleBuffer.h
// MovieMaker
//
// Created by Kevin Meaney on 02/01/2015.
// Copyright (c) 2015 MIT License. All rights reserved.
@import Foundation;
@import AVFoundation;
@interface MICMSampleBuffer : NSObject <NSCopying>
@ericandrewlewis
ericandrewlewis / index.md
Last active June 6, 2024 01:43
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@elliotwoods
elliotwoods / etherdream.cpp
Created August 9, 2016 06:07
Etherdream cross-platform (C++11)
/* Ether Dream interface library
*
* Copyright 2011-2012 Jacob Potter
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of either the GNU General Public License version 2
* or 3, or the GNU Lesser General Public License version 3, as published
* by the Free Software Foundation, at your option.
*
* This program is distributed in the hope that it will be useful,
@djhaskin987
djhaskin987 / png2icns
Created December 21, 2016 19:19
Convert PNG file to ICNS file
# Stolen from here: http://stackoverflow.com/a/20703594/850326
#!/bin/sh
export POSIXLY_CORRECT=1
if [ -z "${1}" -o -z "${2}" ]
then
echo "Usage: ${0} <name> <original-png-location>"
fi
name=$1