A script to fix EDID problems on external monitors in macOS.
-
Connect only the problem display.
-
Create this directory structure (if it doesn't already exist):
import ( | |
"crypto/md5" | |
"encoding/hex" | |
) | |
func GetMD5Hash(text string) string { | |
hasher := md5.New() | |
hasher.Write([]byte(text)) | |
return hex.EncodeToString(hasher.Sum(nil)) | |
} |
var socket = io.connect('http://localhost'); | |
var startTime; | |
setInterval(function() { | |
startTime = Date.now(); | |
socket.emit('ping'); | |
}, 2000); | |
socket.on('pong', function() { | |
latency = Date.now() - startTime; |
RANGE QUERY | |
Given a (big) array r[0..n-1], and a lot of queries of certain type. We may want to pre-process the data so that each | |
query can be performed fast. In this section, we use T (f, g) to denote the running time for an algorithm is O(f(n)) | |
for pre-processing, and O(g(n)) for each query. | |
If the queries are of type getsum(a, b), which asks the sum of all the elements between a and b, inclusive, | |
we have a T (n, 1) algorithm: Compute s[i] to be the sum from r[0] to r[i-1], inclusive, then getsum(a,b) simply | |
returns s[b+1]-s[a]. |
package main | |
/* | |
URL: https://github.com/mccoyst/myip/blob/master/myip.go | |
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/ | |
*/ | |
import ( | |
"net" | |
"os" |
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
.run(function(DB) { | |
DB.init(); | |
}); |
//Filesystem (checkDir, createDir, checkFile, creatFile, removeFile, writeFile, readeFile) | |
.factory('FileService', function($q) { | |
return { | |
checkDir: function (dir) { | |
var deferred = $q.defer(); | |
getFilesystem().then( | |
function(filesystem) { | |
filesystem.root.getDirectory(dir, {create: false}, |
(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.
/** | |
* The width and height to which our graphic assets are designed for | |
* Keep in mind retina resolutions and remember to provide 2xWidth 2xHeight assets for them | |
*/ | |
var targetWidth = 1024; | |
var targetHeight = 768; | |
/** | |
* The main (root) container on the stage | |
* You should always have a master container on your stage |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\Common\Inflector\Inflector; | |
use Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory; | |
use Doctrine\ORM\EntityManager; | |
use Doctrine\ORM\Mapping\ClassMetadata; | |
use Doctrine\ORM\Mapping\ClassMetadataInfo; | |
use Doctrine\ORM\Mapping\MappingException; | |
use Doctrine\ORM\PersistentCollection; | |
use Foodity\CoreBundle\Helper\EntityHelper; |