Multi-series bar chart rendered using React and D3.
😶🌫️
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
# Originally from http://poshcode.org/3819 | |
function Add-ToHostsFile { | |
<# | |
.DESCRIPTION | |
This function checks to see if an entry exists in the hosts file. | |
If it does not, it attempts to add it and verifies the entry. | |
.EXAMPLE | |
Add-ToHostsFile -IPAddress 192.168.0.1 -HostName MyMachine |
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
# Run this in an elevated PowerShell prompt | |
<# This script worked on a fresh Windows Server 2012 VM in Azure and the following were the latest versions of each package at the time: | |
* Chocolatey 0.9.8.27 | |
* java.jdk 7.0.60.1 | |
* apache.ant 1.8.4 | |
* android-sdk 22.6.2 | |
* cordova 3.5.0-0.2.6 | |
* nodejs.install 0.10.29 | |
#> | |
# Note: there is one bit that requires user input (accepting the Android SDK license terms) |
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 Set-UmbracoPermissions($SitePath, $AppPoolAccount, $PathOverrides) | |
{ | |
$readExecute = $AppPoolAccount,"ReadAndExecute","ContainerInherit, ObjectInherit","None","Allow" | |
$read = $AppPoolAccount,"Read","ContainerInherit, ObjectInherit","None","Allow" | |
$modify = $AppPoolAccount,"Modify","ContainerInherit, ObjectInherit","None","Allow" | |
$fileModify = $AppPoolAccount,"Modify","Allow" | |
$objects = @{} | |
$objects["App_Browsers"] = $readExecute | |
$objects["App_Code"] = $modify |
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
void Main() | |
{ | |
// Define all the vertices in the graph | |
var a = new Vertex<string>{ Value = "A" }; | |
var b = new Vertex<string>{ Value = "B" }; | |
var c = new Vertex<string>{ Value = "C" }; | |
var d = new Vertex<string>{ Value = "D" }; | |
var e = new Vertex<string>{ Value = "E" }; | |
var f = new Vertex<string>{ Value = "F" }; | |
var g = new Vertex<string>{ Value = "G" }; |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sweetjs: { | |
options: { | |
modules: ['es6-macros'], | |
sourceMap: true, | |
nodeSourceMapSupport: true | |
}, | |
src: { |
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
macro => { | |
rule infix { ( $arg:ident (,) ... ) | { $body ... $last:expr } } => { | |
(function x( $arg (,) ... ) { | |
$( $body) ... | |
return $last | |
}).bind(this); | |
} | |
rule infix { ( $arg:ident (,) ... ) | $last:expr } => { | |
(function x( $arg (,) ... ) { | |
return $last |
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
var fs = require('fs'); | |
var pathJoin = require('path').join; | |
// Given a repo instance and a fs path, import the path (recursivly) and return | |
// the final root hash. Supports symlinks and executable files. | |
module.exports = function (repo, path, callback) { | |
return importPath(repo, path, function (err, stat) { | |
if (err) return callback(err); | |
return callback(null, stat.hash); | |
}); |
An iterator is an object with a next
method that returns { done, value }
tuples.
An iterable is an object which has an internal method, written in the specs as obj[@@iterator]()
, that returns an iterator. It is not currently specified how to give your own objects such an internal method.
A generator is a specific type of iterator which also has a throw
method, and whose next
method takes a parameter.
A generator function is the source of a generator; you can send values or exceptions into the body of the function via the returned generator's next
and throw
methods. They are created with function*
syntax.