Skip to content

Instantly share code, notes, and snippets.

View tjoen's full-sized avatar

Theun Kohlbeck tjoen

View GitHub Profile
@jakebellacera
jakebellacera / ICS.php
Last active July 10, 2024 11:27
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
// Bind context
_.bindAll( this, "animate", "render", "update" );
// Initialize camera
this.camera = new THREE.Camera( 45, window.innerWidth / window.innerHeight, -2000, 10000 );
this.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, -2000, 10000 );
this.camera.position.y = 70.711;
this.camera.position.x = 100;
this.camera.position.z = 100;
@metaspatial
metaspatial / jquery.cycle.lazy.js
Created September 21, 2011 10:29
Lazy-loading slideshow with jquery.cycle
// this is a rudimentary attempt to implement a slideshow that doesn't saturate downloads with every image upon page load; instead the first slide is embedded in the HTML and loads with the page immediately, the second upon DOM ready, and subsequent upon the advance of each slide; additionally a progress indicator is displayed and slideshow paused if the next slide is still downloading thus preventing displaying partially downloaded images, or missing images entirely
var slides = [ // this is an array of the html representing each slide to display, in reverse order starting with the second slide (the first should be in the HTML page, see below); this markup may contain anything (e.g. li, div, captions) and should have corresponding css, but the first img tag is assumed to be the main image which we monitor for its download state
'<img src="/path/to/file4.jpg">',
'<img src="/path/to/file3.jpg">',
'<img src="/path/to/file2.jpg">',
];
// callback functions
function loadedSlide(){
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@deeplycloudy
deeplycloudy / audioplayer.py
Created March 21, 2012 20:37
Simple Python audio player with matplotlib and pyaudio
""" Play an audio file with pyaudio while concurrently showing audio playhead
on a matplotlib plot of the audio time series and spectrogram.
Adjust duration and filename in the script below to reflect your audio file.
v. 0.1
21 Mar 2012
Eric Bruning
"""
@jasondavies
jasondavies / index.html
Created April 4, 2012 10:02 — forked from robdodson/index.html
D3.js Population Bar Chart
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Population Projection</title>
<link rel="stylesheet" href="main.css">
</head>
@himika
himika / import_facegen_tri.py
Created July 3, 2012 03:39
.tri file importer for Blender 2.49b 要 pyffi 2.1.10
#!BPY
"""
Name: 'FaceGen TRI (.tri)...'
Blender: 249
Group: 'Import'
Tooltip: 'Load a FaceGen TRI file.'
"""
__author__= "himika"
@himika
himika / export_facegen_tri.py
Created July 3, 2012 03:42
.tri file exporter for Blender 2.49b 要 pyffi 2.1.10
#!BPY
"""
Name: 'FaceGen TRI (.tri)...'
Blender: 249
Group: 'Export'
Tooltip: 'Write a FaceGen TRI file.'
"""
__author__= "himika"
@himika
himika / object_transfer_shapes.py
Created July 3, 2012 03:49
(Blender 2.49b用) シェイプキーを別のオブジェクトに移すプラグイン
#!BPY
"""
Name: 'Transfer Shape Keys...'
Blender: 249
Group: 'Object'
Tooltip: 'Copy another selected object's shapes to this one by applying the relative offsets'
"""
__author__ = 'himika'
@NewProggie
NewProggie / gist:3826062
Created October 3, 2012 09:33 — forked from rpls/gist:3760188
Loading and norming WAV files in python.
import wave
import pylab
import os
import numpy as np
def readwavefile(filename):
"""
Reads a WAV file and returns all the frames converted to floats and the framerate.
"""
assert os.path.exists(filename) and os.path.isfile(filename)