This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// a snippet for for iOS scenekit | |
// generate an open half cylinder in such a way that the texture stretches from 0->1 over the surface | |
// the idea is that this could be used for a 180' pano | |
// | |
- (SCNGeometry*) createCurve:(int)resolution width:(float)radius { | |
if(resolution<1)return nil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
function pushme(mydata,mytable) { | |
var postData = JSON.stringify( mydata ); | |
var options = { | |
hostname: 'localhost', | |
port: 1337, | |
path: '/parse/classes/'+mytable, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note that I wrote this in java in Processing - paste this GIST into processing to see it in action. | |
// It is not the most elegant thing ever but it does deal with end caps and ribbon loops and the like. | |
// If you port this over to say objective-c / opengl / c etc - you may need to deal with polygon direction | |
// here is a snapshot of it running : http://www.flickr.com/photos/anselmhook/6507471719/in/photostream | |
int nvertices = 0; | |
float[] vertexpool = new float[3000]; | |
float x1,x2,y1,y2; | |
void intersect(int kind, float x0, float y0, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- see the writeup at https://medium.com/@anselm/playing-with-gps-spatialized-web-audio-f86e45d31d10 --> | |
<canvas id="mycanvas" width=512 height=512> | |
</canvas> | |
<script> | |
// a small database of all the objects | |
let artifacts = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- categories | |
- support | |
- hardware | |
- 3d trackers | |
- rendering | |
- animation | |
- datastore | |
- cloud service | |
- account management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Some scratch code for testing a variety of patterns of client server connection. | |
I needed to send data from an android phone to a macbook via USB and I happened to be using C# under Unity 3D. Some of the problems I ran into included: | |
- co-routines under unity were not fully exhausting the tcp buffers fast enough i think; even when I aggressively polled until they were empty... | |
- kept running into a curious bug where when the android device overheated that there would be a huge latency in traffic from the android device to the desktop. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am anselm on github. | |
* I am anselmhook (https://keybase.io/anselmhook) on keybase. | |
* I have a public key whose fingerprint is 47D8 81E1 7770 619D F180 C796 238F A172 01DE BFE1 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a quick outline of building an web service with these constraints: | |
- some kind of cloud hosting; ie; visibile anywhere on the internet, no fretting over back end unix installs | |
- presents a user editable fillable form on a web page | |
- saves that user supplied form data to persistent state on the server | |
- signs the user supplied information with a private key | |
- does some secure server side transactionally bound database actions | |
- returns a result to the user | |
I've been using firebase lately and I'd definitely do it this way if I was asked to do a quick one off. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See the Figma https://www.figma.com/file/pzq5EhzdxXvhpBoFlB8MDd/Money-Savings-App?node-id=5%3A3 | |
// And see the app https://glitch.com/edit/#!/web3-time-lock | |
pragma solidity >=0.4.22 <0.7.0; | |
contract FutureBank { | |
address private owner; | |
mapping (address => uint256) private balances; | |
mapping (address => uint256) private locktime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a quick recipe for how to have a rust application invoke a javascript method using rusty v8 and do something useful. | |
The rusty v8 source code does show how to do a simpler version of calling rust from javascript in their examples folder - however I wanted an example that ferried some state through javascript back to Rust. In this way javascript can be used as a scripting layer with native code having enough context and information to do real work. Probably another way to do this would be to use a global pointer. | |
Here are some useful links: | |
https://github.com/denoland/rusty_v8/blob/main/examples/hello_world.rs | |
https://github.com/denoland/rusty_v8/blob/main/tests/test_api.rs |