Apple menu -> System Preferences -> Security & Privacy -> Firewall
sudo pfctl -e
sudo dnctl pipe 1 config bw 10Kbit/s
| var cameraZ = camera.position.z; | |
| var planeZ = 5; | |
| var distance = cameraZ - planeZ; | |
| var aspect = viewWidth / viewHeight; | |
| var vFov = camera.fov * Math.PI / 180; | |
| var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance; | |
| var planeWidthAtDistance = planeHeightAtDistance * aspect; | |
| // or |
| vec2 rotate(vec2 v, float a) { | |
| float s = sin(a); | |
| float c = cos(a); | |
| mat2 m = mat2(c, s, -s, c); | |
| return m * v; | |
| } |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.
| // This is free and unencumbered software released into the public domain. | |
| // Marshals a string to an Uint8Array. | |
| function encodeUTF8(s) { | |
| var i = 0, bytes = new Uint8Array(s.length * 4); | |
| for (var ci = 0; ci != s.length; ci++) { | |
| var c = s.charCodeAt(ci); | |
| if (c < 128) { | |
| bytes[i++] = c; | |
| continue; |
| #!/usr/bin/python | |
| #coding:utf-8 | |
| # -- This line is 75 characters ------------------------------------------- | |
| """ | |
| This script will convert a .HDR (radiance) into a RGBM file, | |
| then save it back out as a 8bit (per-channel) .tga | |
| """ | |
| __author__ = 'HogJonny' | |
| # ------------------------------------------------------------------------- |
| ;; I am not a regular emacs user and haven't played with lisp for many years. | |
| ;; I struggled for a couple of days trying to tweak org-capture-templates to | |
| ;; get my desired behavior for journal entries. I hope this helps someone! | |
| ;; | |
| ;; I have been following the excellent guide http://doc.norang.ca/org-mode.html | |
| ;; The "journal" template was the one I wanted to tweak. I use a date-based | |
| ;; journal filename, e.g. "2015-09-22-Journal-Entry.org". The contents of the | |
| ;; file consist of a top-level headline with a human-friendly date, followed | |
| ;; by second-level headline with the time and brief journal note. For example: | |
| ;; |
From N1256: (See http://port70.net/~nsz/c/c99/n1256.html#J.2)
main using one of the specified forms (5.1.2.2.1).I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |