Skip to content

Instantly share code, notes, and snippets.

View davidwparker's full-sized avatar
🙃
Living in the Upside Down

Parker Parker davidwparker

🙃
Living in the Upside Down
View GitHub Profile
_.find(data.messages, function(message) {
if (data.message_id == message.id) {
showMessage(message);
return;
}
});
for (var i=0; i< data.messages.length; i++) {
if (data.message_id == data.messages[i].id) {
showMessage(data.messages[i]);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
@davidwparker
davidwparker / 023.c
Created January 9, 2013 17:25
OpenGL Screencast 23: tessellation
#include "screencasts.h"
/*
* initGlobals()
* ------
* Initializes the global variables.
*/
void initGlobals(void)
{
/* WINDOW */
@davidwparker
davidwparker / 022.c
Created December 30, 2012 18:27
OpenGL Screencast 22: Fog
#include "screencasts.h"
/*
* initGlobals()
* ------
* Initializes the global variables.
*/
void initGlobals(void)
{
/* WINDOW */
@davidwparker
davidwparker / 021.c
Created December 26, 2012 21:08
OpenGL Screencast 21: Skybox
#include "screencasts.h"
/*
* initGlobals()
* ------
* Initializes the global variables.
*/
void initGlobals(void)
{
/* WINDOW */
@davidwparker
davidwparker / youtubehistory.js
Created December 22, 2012 06:38
Run this in console of youtube history page (after expanding out history) to get count of video time
var data=document.getElementsByClassName('video-time');
var re = /^([2][0-3]|[0-1]?[0-9])([.:][0-5]?[0-9])?$/;
var total=0;
for(var i=0;i<data.length;i++){
var j=data.item(i).innerText;
var match=re.exec(j);
if (match != null) {
total += parseInt(match[1])
}
}
@davidwparker
davidwparker / 020.c
Created December 21, 2012 18:39
OpenGL Screencast 20: Anti-Aliasing
#include "screencasts.h"
/*
* initializeGlobals()
* ------
* Initializes the global variables.
*/
void initializeGlobals(void)
{
/* WINDOW */
@davidwparker
davidwparker / Haiku
Created November 15, 2012 04:42
A haiku for my love
For her I create
I make love and choc-o-late
She loves me bunches
@davidwparker
davidwparker / version1.py
Created October 7, 2012 21:59
Christmas randomization
import cProfile
import random
class Simulation:
def run(self):
self.names = [{'name':'david','spouse':'tyler'},{'name':'tyler','spouse':'david'},
{'name':'jon','spouse':'bonnie'},{'name':'bonnie','spouse':'jon'},
{'name':'jake','spouse':'caitlin'},{'name':'caitlin','spouse':'jake'},
{'name':'dad', 'spouse':'mom'},{'name':'mom','spouse':'dad'}]
okay = False