Skip to content

Instantly share code, notes, and snippets.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jazzdan
jazzdan / a.php
Last active August 29, 2015 13:59
<?php
require 'src/Mustache/Autoloader.php';
Mustache_Autoloader::register();
$m = new Mustache_Engine([
'partials' => [
'header' => '<title>{{$title}}Default title{{/title}}</title>',
'base' => '<html>{{$header}}{{/header}}{{$content}}{{/content}}</html>'
],

Keybase proof

I hereby claim:

  • I am jazzdan on github.
  • I am dmiller (https://keybase.io/dmiller) on keybase.
  • I have a public key whose fingerprint is C1EF 112B 5AD3 C157 C582 D15B 56E1 4C55 60A2 1CD0

To claim this, I am signing this object:

@jazzdan
jazzdan / test.php
Created June 18, 2014 22:24
Tokens vanishing in mustache.php
<?php
require 'src/Mustache/Autoloader.php';
Mustache_Autoloader::register();
$m = new Mustache_Engine([
'partials' => [
],
]);
@jazzdan
jazzdan / test.rb
Created June 18, 2014 22:39
mustache.rb throws an exception
require 'mustache'
output = Mustache.render("<h1>{{{blah}}</h1>", :blah=> "hello world!")
puts output
# =>
#/Users/dmiller/.rbenv/versions/1.9.2-p180/lib/ruby/gems/1.9.1/gems/mustache-0.99.5/lib/mustache/parser.rb:264:in `error': Unclosed tag (Mustache::Parser::SyntaxError)
# Line 1
# <h1>{{{blah}}</h1>
# ^
@jazzdan
jazzdan / commit.diff
Last active August 29, 2015 14:07
Add option to HHVM similar to --with-config-file-scan-dir
commit 0c41732a7ca14b15437f115c51b06e829988f048
Author: Dan Miller <dmiller@etsy.com>
Date: Fri Oct 3 16:27:06 2014 +0000
Add config-scan-dir option
diff --git a/hphp/runtime/base/program-functions.cpp b/hphp/runtime/base/program-functions.cpp
index b97e086..ba803f6 100644
--- a/hphp/runtime/base/program-functions.cpp
+++ b/hphp/runtime/base/program-functions.cpp
<?php
function add(int $a, int $b): int {
myLog($a + $b);
return $a + $b;
}
<?php
declare(strict_types=1);
function myLog(string $message): string {
return $message;
}
function add(int $a, int $b): int {
myLog($a + $b);
return $a + $b;
<?hh
declare(strict_types=1);
function myLog(string $message=null): string {
if ($message === null) {
return '';
} else {
return $message;
}
}
<?hh
declare(strict_types=1);
function myLog(?string $message=null): string {
if ($message === null) {
return '';
} else {
return $message;
}
}