Skip to content

Instantly share code, notes, and snippets.

Hello world!

Keybase proof

I hereby claim:

  • I am mkantor on github.
  • I am mkantor (https://keybase.io/mkantor) on keybase.
  • I have a public key ASDN-v3INYjOKlv-EAJ7ViUk2UpOASXZTJetSvO5xumNhQo

To claim this, I am signing this object:

// @ts-check
const schedule = [
13,
'x',
'x',
41,
'x',
'x',
'x',
function bar(): void {
console.log('hello')
}
export class ClassWithClosedOverFunction {
constructor() {
bar()
}
}
/*
$ php requirer.php
before php tag in required.php
inside php tag in required.phpafter php tag in required.php
require_result: 1
global_var: global var from required.php
@mkantor
mkantor / bq_publicdata_samples_metadata.json
Created April 20, 2016 16:20
Output of `bq --format=prettyjson show publicdata:samples` on 2016-04-20.
{
"access": [
{
"role": "READER",
"specialGroup": "projectReaders"
},
{
"role": "WRITER",
"specialGroup": "projectWriters"
},
@mkantor
mkantor / fiddle.css
Last active December 17, 2015 10:38
Demonstrate two column CSS table layout.
nav {
display: table-cell;
padding-right: 5px;
background: yellow;
white-space: nowrap; /* Prevent nav from ever inserting line breaks between words (like before "(p)"). */
}
#content {
display: table-cell;
padding-left: 5px;
@mkantor
mkantor / strpos.php
Last active December 17, 2015 00:29 — forked from pborreli/strpos.php
$ uname -a
Linux betty 2.6.32-46-generic #108-Ubuntu SMP Thu Apr 11 15:55:01 UTC 2013 i686 GNU/Linux
$ php --version
PHP 5.3.2-1ubuntu4.19 with Suhosin-Patch (cli) (built: Mar 11 2013 15:23:47)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
$ for i in {1..3}; do time php substrstrlen.php; done
@mkantor
mkantor / scoping_demo.php
Last active December 17, 2015 00:09
Demonstrate PHP's function scoping.
<pre>
<?php
$x = 'value set in global scope';
function namedFunction() {
echo 'in '.__FUNCTION__.', before setting $x: $x === '.var_export($x, true)."\n";
$x = 'value set in '.__FUNCTION__;
echo 'in '.__FUNCTION__.', after setting $x: $x === '.var_export($x, true)."\n";
}
@mkantor
mkantor / push.sh
Created May 2, 2013 05:12
Make sure that the `master` and `gh-pages` branches are identical on `origin`.
#!/bin/sh
echo 'Pushing master to origin/master...'
git push origin master
echo 'Pushing origin/master to origin/gh-pages...'
git push origin origin/master:gh-pages