caffeinate -u -t 3600
defaults read com.apple.screensaver askForPasswordDelay
| On OSX Yosemite and above, in a terminal window: | |
| 1. Switch to the root user. | |
| $ sudo su - | |
| 2. Create a Dummynet pipe that represents a slow, unreliable network: | |
| # dnctl pipe 1 config bw 10Kbit/s delay 300 plr 0.1 noerror |
| -- pop the last element from LIST_KEY that doesn't match SEARCH arg | |
| local LIST_KEY = KEYS[1] | |
| local SEARCH = ARGV[1] | |
| -- avoid the expensive LRANGE by peeking the last element | |
| local last = redis.call('LINDEX', LIST_KEY, -1) | |
| if not (string.find(last, SEARCH)) then | |
| redis.call('RPOP', LIST_KEY) | |
| return last | |
| end |
http://outworkers.com/blog/post/a-series-on-cassandra-part-1-getting-rid-of-the-sql-mentality
http://outworkers.com/blog/post/a-series-on-cassandra-part-2-indexes-and-keys
http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling
https://medium.com/@mustwin/cassandra-from-a-relational-world-7bbdb0a9f1d#.4uez1443i
| function transferCredits(from, to, amt) { | |
| var fromAccount = db.game_accounts.findOne({"name": from},{"credits": 1}); | |
| var toAccount = db.game_accounts.findOne({"name": to},{"credits": 1}); | |
| db.game_accounts.update({name: from}, {$set: {credits: fromAccount.credits - amt}}); | |
| db.game_accounts.update({name: to}, {$set: {credits: toAccount.credits + amt}}); | |
| } | |
| db.game_accounts.insert({name: "John", credits: 1000}); | |
| db.game_accounts.insert({name: "Jane", credits: 1000}); |
| class GameObject { | |
| constructor(name) { | |
| this.name = name; | |
| } | |
| sayName() { | |
| console.log(`Hi, I am ${this.name}`); | |
| } | |
| } |
| package main | |
| import ( | |
| "log" | |
| "reflect" | |
| "strings" | |
| ) | |
| type RoleAccess struct { | |
| RoleName string |