Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
This file contains hidden or 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
import React from 'react'; | |
class ReducerComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
reducer = (state, action) => state; | |
dispatch = action => this.setState(state => this.reducer(state, action)); |
This file contains hidden or 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
// | |
// BackgroundTask.h | |
// tomtrack | |
// | |
// Created by Liam Edwards-Playne on 13/02/2016. | |
// | |
#import "RCTBridgeModule.h" | |
@interface BackgroundTask : NSObject <RCTBridgeModule> |
This file contains hidden or 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>; |
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 hidden or 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 |
This file contains hidden or 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 |
$ brew install unbound ldns
Now we can edit the configuration file of unbound which by default is located in /usr/local/etc/unbound/unbound.conf
:
This file contains hidden or 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 hidden or 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]; | |
}; |
NewerOlder