Skip to content

Instantly share code, notes, and snippets.

View seagoj's full-sized avatar

Jeremy Seago seagoj

View GitHub Profile
function it_saves_values_to_repository(
Devtools\Model $model,
Repository\UserRepositoryAdapter $repository
) {
$repository
->getProperties()
->shouldBeCalled()
->willReturn(
[
'userId',
@seagoj
seagoj / gist:86c919f6d4c821557eaa
Created October 22, 2014 18:03
Discern between SELECT, INSERT & UPDATE
$stmt = $this->connection->prepare($queryString);
$executeResult = !is_null($params)
? $stmt->execute($params)
: $stmt->execute();
$data = $stmt->fetchAll($fetchType);
$isInsertStatement = empty($data)
&& $executeResult
&& ($lastInsertId = $this->connection->lastInsertId()) !== 0;
$isUpdateStatement = empty($data);
@seagoj
seagoj / Response.php
Created November 11, 2014 01:03
Autoloading
<?php namespace Devtools;
// /vendor/Devtools/Response.php
class Response
{
...
}
@seagoj
seagoj / app.js
Created January 21, 2015 20:46
browserify-shim
"use strict"
var $ = require('jquery');
require('fixedheadertable');
// ...
@seagoj
seagoj / object.js
Created January 28, 2015 21:22
set property via ajax
var object = (function() {
var property;
var init = function() {
$.ajax({
url: '/get/property',
data: {'get': 'property'},
success: function(data) {
property = data.property;
}
@seagoj
seagoj / object.js
Created January 29, 2015 22:11
Testing event handlers
module.exports = (function() {
var bindUI = function() {
$(element).click(doThatThing);
};
var doThatThing = function() {
return 'that thing';
};
return {
@seagoj
seagoj / Option1.htm
Created March 28, 2015 16:25
Flash Video
<!--// Try this one first //-->
<object type="application/x-shockwave-flash" data="http://45.55.147.76/flash.swf"
width='550'
height='300'
>
<param name="movie" value="http://45.55.147.76/flash.swf" />
<param name="quality" value="high" />
</object>
@seagoj
seagoj / canada.html
Last active August 29, 2015 14:17
Canada
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>amMap example</title>
<link rel="stylesheet" href="../ammap/ammap.css" type="text/css">
<script src="../ammap/ammap.js" type="text/javascript"></script>
<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
@seagoj
seagoj / keybase.md
Created April 14, 2015 16:54
keybase.md

Keybase proof

I hereby claim:

  • I am seagoj on github.
  • I am seagoj (https://keybase.io/seagoj) on keybase.
  • I have a public key whose fingerprint is E75E FB01 8FAC 9FE5 9ABE 4393 C7C0 9A06 189A 6BF6

To claim this, I am signing this object:

@seagoj
seagoj / hooks-ctags
Created August 4, 2015 23:00
hook for generating ctags
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
dir="`git rev-parse --git-dir`"
trap 'rm -f "$dir/$$.tags"' EXIT
git ls-files | ctags --tag-relative -L - -f"$dir/$$.tags" --languages=php,-sql,-javascript
mv "$dir/$$.tags" "$dir/tags"