(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| using UnityEngine; | |
| using UnityEditor; | |
| using System; | |
| using System.Reflection; | |
| public class WebWindow : EditorWindow { | |
| static Rect windowRect = new Rect(100,100,800,600); | |
| static BindingFlags fullBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; | |
| static StringComparison ignoreCase = StringComparison.CurrentCultureIgnoreCase; | 
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env python3 | |
| # encoding: utf-8 | |
| """Use instead of `python3 -m http.server` when you need CORS""" | |
| from http.server import HTTPServer, SimpleHTTPRequestHandler | |
| class CORSRequestHandler(SimpleHTTPRequestHandler): | |
| def end_headers(self): | |
| self.send_header('Access-Control-Allow-Origin', '*') | 
| # input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with | |
| # the "auth" aka "certonly" subcommand | |
| # convert certificate chain + private key to the PKCS#12 file format | |
| openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem | |
| # convert PKCS#12 file into Java keystore format | |
| keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks | |
| # don't need the PKCS#12 file anymore | 
| import rx.Observable; | |
| import rx.Subscriber; | |
| import rx.Subscription; | |
| import rx.functions.Action0; | |
| import rx.subjects.PublishSubject; | |
| import rx.subjects.SerializedSubject; | |
| /** | |
| * An object reference of EventBus | 
| alias accio=wget | |
| alias avadaKedavra='rm -f' | |
| alias imperio=sudo | |
| alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"' | |
| alias stupefy='sleep 5' | |
| alias wingardiumLeviosa=mv | |
| alias sonorus='set -v' | |
| alias quietus='set +v' | 
| import appleseed as asr | |
| mesh = asr.MeshObject("my_mesh", {}) | |
| print mesh | |
| # Vertices | |
| v0 = asr.Vector3f([0.0, 0.0, 0.0]) | |
| v1 = asr.Vector3f([1.0, 0.0, 0.0]) | |
| v2 = asr.Vector3f([0.0, 0.0, 1.0]) | 
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a | 
This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x
The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/
| courtesy: cmpxchg aka tim murray | |
| suspend is the big hammer. in suspend, you turn off all peripherals, turn off the CPUs entirely, | |
| put the DRAM into self-refresh. power consumption is very low. if you've ever put a tablet on | |
| a table and come back a month later to find that it's still on, that's because it's been suspend | |
| 99.9% of the time, and it's drawing a tiny amount the whole time. | |
| problem with suspend is that it takes a nontrivial amount of time to enter/exit, so you can't | |
| do it when somebody has to interact with the phone soon. on Android, suspend never happens while | |
| the screen is on. if you ever wondered what a wakelock actually does, it prevents suspend. that's it. |