Skip to content

Instantly share code, notes, and snippets.

View danzeeeman's full-sized avatar

Dan Moore danzeeeman

View GitHub Profile
@danzeeeman
danzeeeman / gradientdescent.py
Last active December 5, 2022 18:47
write a gradient descent neural network in numpy
# Import NumPy
import numpy as np
# Define the architecture of the network
n_inputs = 2
n_hidden = 3
n_outputs = 1
# Initialize the weights and biases
weights = {
@danzeeeman
danzeeeman / main.cpp
Created December 2, 2022 17:59
write an openFrameworks particle system
#include "ofMain.h"
class Particle {
public:
ofPoint position;
ofPoint velocity;
float radius;
ofColor color;
Particle() {
@danzeeeman
danzeeeman / main.cpp
Created December 2, 2022 17:04
write an openframeworks application that has a slider controlling a shader and an osc sender that sends out current time
#include "ofMain.h"
#include "ofxOsc.h"
// application settings
const int APP_WIDTH = 1280;
const int APP_HEIGHT = 720;
const string OSC_HOST = "localhost";
const int OSC_PORT = 8888;
// osc sender
require('dotenv').config('dot.env');
var fs = require('fs');
var util = require('util');
var log_file = fs.createWriteStream(__dirname + '/debug.log', {flags : 'w'});
var log_stdout = process.stdout;
console.log = function(d) { //
log_file.write(d + '\n');
log_stdout.write(d + '\n');
@danzeeeman
danzeeeman / WW3
Created February 21, 2022 23:08
Subscribe to the start of WW3
// Creates a client
const translate = new Translate({projectId});
async function translateText(text, target) {
// Translates the text into the target language. "text" can be a string for
// translating a single piece of text, or an array of strings for translating
// multiple texts.
let [translations] = await translate.translate(text, target);
translations = Array.isArray(translations) ? translations : [translations];
console.log('Translations:');
@danzeeeman
danzeeeman / twitterList.js
Created December 12, 2017 19:28
Twitter Bot to track hashtag and add to list. Good for trolling Roy Moore Supporters
var Twitter = require('twitter');
var client = new Twitter({
consumer_key: 'x',
consumer_secret: 'x',
access_token_key: 'x',
access_token_secret: 'x'
});
var list = "";
var params = { track: 'SearchKey' };

Keybase proof

I hereby claim:

  • I am danzeeeman on github.
  • I am thedantheman (https://keybase.io/thedantheman) on keybase.
  • I have a public key ASBSworvMg4nkMxgdlC9A-7lEMbCnxKYxYllZ25_k9raTwo

To claim this, I am signing this object:

Otherlab - https://github.com/otherlab
Dreamworks - https://github.com/dreamworksanimation
Pixar - https://github.com/PixarAnimationStudios
Razorfish - https://github.com/razorfish
Google Creative Labs - https://github.com/googlecreativelab
Google Data Arts Team - https://github.com/dataarts
Deep Local - https://github.com/deeplocal
Red Paper Heart - https://github.com/redpaperheart
Fake Love - https://github.com/fakelove
LAB at Rockwell - https://github.com/labatrockwell
@danzeeeman
danzeeeman / openFrameworks VS FIX
Created January 31, 2017 20:23
openFrameworks VS FIX
Select them all, right-click > Properties. In the Property page, go to Configuration Properties > C/C++ > Output Files
There, for Object File Name, replace $(IntDir) by $(IntDir)/%(RelativeDir)/
https://docs.google.com/presentation/d/1vRTBOBeAJ6gt1qEKz_RQBUB2ET_47jE2bZ6JKZQjff0/edit?usp=sharing