type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value } |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference/hit 1.5 ns 4 cycles | |
Floating-point add/mult/FMA operation 1.5 ns 4 cycles | |
L2 cache reference/hit 5 ns 12 ~ 17 cycles | |
Branch mispredict 6 ns 15 ~ 20 cycles | |
L3 cache hit (unshared cache line) 16 ns 42 cycles | |
L3 cache hit (shared line in another core) 25 ns 65 cycles | |
Mutex lock/unlock 25 ns | |
L3 cache hit (modified in another core) 29 ns 75 cycles |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
gpg --list-secret-keys
and look for sec
, use the key ID for the next stepgit
to use GPG -- replace the key with the one from gpg --list-secret-keys
/* | |
* var person = { firstName: 'bill', lastName: 'johnson' } | |
* | |
* person = _.rename(person, 'firstName', 'first') | |
* person = _.rename(person, 'lastName', 'last') | |
* | |
* console.log(person) // { first: 'bill', last: 'johnson' } | |
*/ | |
_.rename = function(obj, key, newKey) { |
... |
var string = "Sawasdee --> สวัสดี"; | |
var crypto = require('crypto'); | |
crypto.createHash('md5').update(string, 'utf8').digest("hex"); |
from datetime import datetime | |
from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declared_attr | |
from flask_security import current_user | |
class AuditMixin(object): | |
created_at = Column(DateTime, default=datetime.now) | |
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |