Skip to content

Instantly share code, notes, and snippets.

View martinbean's full-sized avatar

Martin Bean martinbean

View GitHub Profile
@malarkey
malarkey / Contract Killer 3.md
Last active May 8, 2024 16:02
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@mnapoli
mnapoli / behat-reference.feature
Last active February 12, 2024 10:54
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@martinbean
martinbean / WHOIS look-up bookmark
Created October 26, 2010 10:06
Want to quickly do a WHOIS look-up of the domain of the current website you're browsing? Simple save the following snippet as a bookmark in your favourite WebKit-enabled web browser...
javascript:var loc=window.location.host;window.location.href='http://whois.domaintools.com/'+loc;
@taylorotwell
taylorotwell / tenant-middleware
Created December 1, 2015 03:07
Magical tenant middleware thing
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Auth\Access\AuthorizationException;
class VerifyTenants
{
/**
@mmeyer2k
mmeyer2k / phpunit4circle.sh
Last active November 3, 2021 21:33
circle.ci parallelism for phpunit
#!/bin/sh
# circle.ci parallelism appends the subset of files to run in the container
# to the end of the test command. phpunit does not automatically parse files
# appended to the argument like this:
#
# phpunit --some-args 'testSomething1.php' 'testSomething2.php'
#
# this script parses arguments and individually dispatches calls to phpunit
#
var app = app || {};
//object literal
app = {
init: function(){
this.cache();
this.bind();
},
cache: function(){
@oli-logicnow
oli-logicnow / gist:68008b7f7b352d72755f5fa2aced5760
Created July 19, 2016 10:52
debugging hanging processes (network connection edition)
strace -p {{PROCESS_ID}}
poll([{fd=20, events=POLLIN}], 1, 0) = 0 (Timeout) << see timeout
GRAB FileDescriptor (20)
ls -l /proc/{{PROCESS_ID}}/fd/{{FD}}
lrwx------ 1 root root 64 Jul 18 15:41 /proc/29915/fd/20 -> socket:[2426613614]
GRAB SOCKET (2426613614)
lsof | grep {{SOCKET}}
@coldclimate
coldclimate / gist:464e6e5174d9a5ffcc6a
Created March 24, 2016 08:51
Get a list of all access keys on an AWS account
for USERNAME in `aws iam list-users | jq -r '.Users[].UserName'`
do
KEYS=$(aws iam list-access-keys --user-name $USERNAME | jq '.AccessKeyMetadata[].AccessKeyId')
echo $USERNAME, $KEYS
done