Skip to content

Instantly share code, notes, and snippets.

View mjkaufer's full-sized avatar
🏂

Matthew Kaufer mjkaufer

🏂
View GitHub Profile
@bnmnetp
bnmnetp / simpleskulpt.html
Last active October 15, 2023 09:11
Here is about the simplest example I can think of that gets you a working skulpt environment. This little sample shows regular python as well as importing a module.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="http://www.skulpt.org/js/skulpt.min.js" type="text/javascript"></script>
<script src="http://www.skulpt.org/js/skulpt-stdlib.js" type="text/javascript"></script>
</head>
<body>

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
var WAVE={};
(function(){
function str16(x){return (x>15)?x.toString(16):"0"+x.toString(16);}
function shortToStr(x){return "%"+str16(x&0xff)+"%"+str16((x>>>8)&0xff);}
function intToStr(x){return "%"+str16(x&0xff)+"%"+str16((x>>>8)&0xff)+"%"+str16((x>>>16)&0xff)+"%"+str16((x>>>24)&0xff);}
WAVE.makeWavDecimal=function(channels,sampleFrequency)
{
var str="data:audio/x-wav,%52%49%46%46"+
intToStr(channels.length*2*channels[0].length+0x24)+
"%57%41%56%45%66%6D%74%20"+
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.