Skip to content

Instantly share code, notes, and snippets.

implicit def writeableOf_AnyContentAsMultiPartFormData(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData] = {
writeableOf_multiPartFormData(codec).map(c => c.asMultipartFormData.getOrElse(MultipartFormData(Map(), List(), List(), List())))
}
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix coreutils)/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix coreutils)/libexec/gnuman $1; else man $1; fi }; _'
@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
@mkantor
mkantor / fiddle.css
Last active December 16, 2015 17:59
progress {
display: block;
}
.winner {
background-color: lime;
}
This is a gist.
@mkantor
mkantor / Contract Killer 3.md
Created November 24, 2012 18:50 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.