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
namespace scanner { | |
type stateFn = { | |
(l: Lexer): stateFn | |
} | |
export enum itemType { | |
itemEof, | |
itemErr, | |
itemStart, |
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
var hash:{[a:string]:number} = arr.reduce((prev, curr, idx) => { | |
prev[curr] = idx; | |
return prev; | |
}, {}); |
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
// merge two sorted arrays | |
// algorithm from | |
// - Sorting by merging, The art of computer programing | |
function merge(x:any[], y:any[]) { | |
const iLen = x.length, | |
jLen = y.length; | |
let i = 0, | |
j = 0, |
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
function checkCashRegister(price, cash, cid) { | |
const units = [ | |
{unit: 'ONE HUNDRED', cents: 10000}, | |
{unit: 'TWENTY', cents: 2000}, | |
{unit: 'TEN', cents: 1000}, | |
{unit: 'FIVE', cents: 500}, | |
{unit: 'ONE', cents: 100}, | |
{unit: 'QUARTER', cents: 25}, | |
{unit: 'DIME', cents: 10}, |
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
package main | |
import ( | |
"errors" | |
"io" | |
"os/exec" | |
) | |
var ( | |
// ErrNoCommandsProvided is returned when there were no commands provided to |
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
" Note: Skip initialization for vim-tiny or vim-small. | |
if !1 | finish | endif | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ |
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 | |
namespace Ticker\Form\Factory; | |
use Ticker\Form\TickerFieldset; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
// lives in FormElementManager | |
class TickerFieldsetFactory | |
{ |
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>Dm</title> | |
</head> | |
<body> | |
<h2>Hello</h2> | |
<div id="player-container"></div> | |
<script src="http://api.dmcdn.net/all.js"></script> |
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 | |
$container['pdo'] = function ($C) {return new Pdo(..);} | |
$container['B'] = function ($c) {return new B($c['pdo']);} // pass in the dependency | |
$container['C'] = function ($c) {return new C($c['B']);} | |
class B { | |
function __construct(\PDO $a){} | |
} | |
class C { | |
function __construct(B $b){} |
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
[Composer\Downloader\TransportException] | |
The "http://packagist.org/p/provider-2014%24bb917b85df9caebd44d09f44aab6d937bb75350df589883d5d | |
c222e3627eea41.json" file could not be downloaded: failed to open stream: HTTP request failed! |