Skip to content

Instantly share code, notes, and snippets.

:shipit:
hg commit

Dan Harper danharper

:shipit:
hg commit
Block or report user

Report or block danharper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@danharper
danharper / ex.md
Last active Aug 29, 2015
how i feel css pre-processors should be: extending the language via namespaced (prefix) attributes & functions - NOT via @include stuff
View ex.md

In raw CSS:

.foo {
  background: -webkit-linear-gradient(red, green) left repeat;
  background: linear-gradient(red, green) left repeat;
  -webkit-transition: all 0.8s;
  -moz-transition: all 0.8s;
  transition: all 0.8s;
  color: green;
View gist:92b73264493bc41eee24

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

View deploy.sh
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
View keybase.md

Keybase proof

I hereby claim:

  • I am danharper on github.
  • I am danharper (https://keybase.io/danharper) on keybase.
  • I have a public key whose fingerprint is 4EC0 F75A E4A4 CF06 0F41 BCB9 9596 CB4A 8D08 3A0A

To claim this, I am signing this object:

View a.php
<?php
// Version A: Facades everywhere - typical Laravel 4.2 style
// routes.php
Route::get('payments', 'BillingController@recentPayments');
// BillingController.php
class BillingController {
@danharper
danharper / ffo.html
Created Oct 23, 2014
191 chars. Not selectable due to psuedo elements.
View ffo.html
<!doctype html>
<title></title>
<style>
*{display:block;}
title:before{content:"<!doctype html><title></title>";}
style:before{content:"<style>";}
style:after{content:"\3C/style>";}
</style>
View down.php
<?php
http_response_code(503);
$message = 'Temporary application maintenance in progress. Please try again shortly.';
if (isset($_SERVER['Content-Type']) && strpos($_SERVER['Content-Type'], 'json') !== false)
{
header('Content-Type', 'application/json');
echo json_encode(['error' => $message]);
@danharper
danharper / Builder.php
Last active Aug 29, 2015
Simple Immutable Builder
View Builder.php
<?php
abstract class Builder {
abstract function build();
function __call($name, $arguments)
{
if ( ! property_exists($this, $name))
{
@danharper
danharper / keyboard.coffee
Last active Aug 29, 2015
Small wrapper around Ionic's Keyboard plugin for Cordova; works in Browser (https://github.com/driftyco/ionic-plugins-keyboard)
View keyboard.coffee
define [], () ->
hasCordova = window.cordova?
class Keyboard
open: ->
if hasCordova
cordova.plugins.Keyboard.show()
else
console.info 'would open Keyboard'
You can’t perform that action at this time.