$ brew install unbound ldns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.fn.centerPoint = function() | |
{ | |
return { | |
x: this.position().left + (this.outerWidth(true) / 2), | |
y: this.position().top + (this.outerHeight(true) / 2) | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide editor on specific pages. | |
* | |
*/ | |
add_action( 'admin_init', 'hide_editor' ); | |
function hide_editor() { | |
// Get the Post ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fibMemo = call_user_func(function () { | |
$memo = array(0 => 0, 1 => 1); | |
$fib = function ($n) use (&$memo, &$fib) { | |
if (!isset($memo[$n])) { | |
$memo[$n] = $fib($n - 1) + $fib($n - 2); | |
} | |
return $memo[$n]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>WebWorker image preloading</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> | |
</head> | |
<body> | |
<div id="output"></div> | |
<script id="imgloader" type="javascript/worker"> | |
// Not race proof or robust. Proof of concept. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include(CMakeParseArguments) | |
find_program(NIM_EXECUTABLE nimrod PATHS ENV PATH) | |
mark_as_advanced(NIM_EXECUTABLE) | |
# Determine the valac version | |
if(NIM_EXECUTABLE) | |
execute_process(COMMAND ${NIM_EXECUTABLE} "--version" | |
OUTPUT_VARIABLE NIM_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello. There is now a module for this. | |
// https://github.com/0x8890/error-class | |
// $ npm install error-class | |
const hasCaptureStackTrace = 'captureStackTrace' in Error | |
// Internal function to set up an error. | |
function setup (message) { | |
const { constructor, constructor: { name } } = this |
I got a contribution from @saljam at boot2docker-xhyve on GitHub as below.
Running boot2docker xhyve on boot · ailispaw/boot2docker-xhyve Wiki
It allows us to launch boot2docker-xhyve on booting Mac OS X.
In addition, I found LaunchControl that enables us to manage lanuchd and edit its configuration files with GUI.
And also it has a menu bar item which we can control launchd daemons/services from.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module "immutable" { | |
declare class Iterable<K, V> { | |
static isIterable(maybeIterable: any): boolean; | |
static isKeyed(maybeKeyed: any): boolean; | |
static isIndexed(maybeIndexed: any): boolean; | |
static isAssociative(maybeAssociative: any): boolean; | |
static isOrdered(maybeOrdered: any): boolean; | |
toArray(): Array<V>; | |
toIndexedSeq(): IndexedSeq<V>; |
OlderNewer