RTB周りで使われているというCookie Syncについて興味がわいたので調べてみる。
Quoraから。
| // Takes string of Note + Octave | |
| // Example: | |
| // var frequency = getFrequency('C3'); | |
| var getFrequency = function (note) { | |
| var notes = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'], | |
| octave, | |
| keyNumber; | |
| if (note.length === 3) { |
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| username: vagrant | |
| password: vagrant | |
| sudo apt-get update | |
| sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
| sudo aptitude install mysql-server mysql-client | |
| sudo nano /etc/mysql/my.cnf |
| var mqtt = require('mqtt'); | |
| mqtt.createConnection(1883, 'localhost', function(err, client) { | |
| if (err) { | |
| console.dir(err); | |
| return process.exit(-1); | |
| } | |
| var events = ['connack', 'puback', 'pubrec', 'pubcomp']; |
| def index(id:String) = Action { | |
| getFirstData(id) | |
| } | |
| private def getFirstData(id:String) = { | |
| Cache.get(id) match { | |
| case Some(id2) => getSecondData(id2) | |
| case None => NotFound | |
| } | |
| } | |
| private def getSecondData(id2:String) = { |
| ## Configure eth0 | |
| # | |
| # vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| DEVICE="eth0" | |
| NM_CONTROLLED="yes" | |
| ONBOOT=yes | |
| HWADDR=A4:BA:DB:37:F1:04 | |
| TYPE=Ethernet | |
| BOOTPROTO=static |