Skip to content

Instantly share code, notes, and snippets.

View nasser's full-sized avatar
🛰️
save-lisp-and-die

Ramsey Nasser nasser

🛰️
save-lisp-and-die
View GitHub Profile
@nasser
nasser / index.html
Created April 18, 2018 02:50
socket drawing
<!-- in public folder -->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0>
<style> body {padding: 0; margin: 0;} </style>
<script src="p5.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<!-- <script src="../addons/p5.dom.min.js"></script> -->
<!-- <script src="../addons/p5.sound.min.js"></script> -->
@nasser
nasser / socketio.svg
Created April 18, 2018 02:49
socketio
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nasser
nasser / deploying.svg
Created April 11, 2018 02:50
deploying
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nasser
nasser / index.html
Created April 4, 2018 02:40
remember the index.html goes into a folder called 'public'
<!DOCTYPE html>
<html>
<head>
<title>Express Demo</title>
</head>
<body>
Served by <em>Express™</em>
<img src="hacker.jpg" width=100>
<!-- <a href="some-page">Go to some page!</a> -->
<form method="post" action="/contact">
var osc = require('node-osc');
var client = new osc.Client('149.31.122.172', 1234);
// /1/xy
// /1/fader1
// /1/fader2
// /1/fader3
// client.send("/1/fader1", 100);
@nasser
nasser / client.js
Created March 16, 2018 18:02
node.js OSC demo — remember to first do npm install node-osc
var osc = require('node-osc');
var client = new osc.Client('127.0.0.1', 3333);
client.send('/paddle-position', 90, function () {
client.kill();
});
@nasser
nasser / electron.svg
Created March 14, 2018 02:49
electron
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nasser
nasser / work-in-progress.svg
Created March 14, 2018 00:42
work-in-progress
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nasser
nasser / particles.clj
Created March 11, 2018 17:34
particles
(ns nasser.particles)
(defn new-particle
([x y vx vy] {::x x ::y y ::vx vx ::vy vy})
([x y] (new-particle x y 0 0)))
(defn particles-at-origin [n]
(repeat n (new-particle 0 0)))
(defn random-particle []