Skip to content

Instantly share code, notes, and snippets.

namespace scanner {
type stateFn = {
(l: Lexer): stateFn
}
export enum itemType {
itemEof,
itemErr,
itemStart,
var hash:{[a:string]:number} = arr.reduce((prev, curr, idx) => {
prev[curr] = idx;
return prev;
}, {});
// 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,
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},
package main
import (
"errors"
"io"
"os/exec"
)
var (
// ErrNoCommandsProvided is returned when there were no commands provided to
" 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/
@alihammad-gist
alihammad-gist / Ticker\Form\Factory\TickerFieldsetFactory.php
Created January 9, 2016 19:33
Factory not being found by FormElementManager
<?php
namespace Ticker\Form\Factory;
use Ticker\Form\TickerFieldset;
use Zend\ServiceManager\ServiceLocatorInterface;
// lives in FormElementManager
class TickerFieldsetFactory
{
<!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>
<?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){}
[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!