Skip to content

Instantly share code, notes, and snippets.

💻
Learning me some Golang

Colin O'Dell colinodell

💻
Learning me some Golang
Block or report user

Report or block colinodell

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
@colinodell
colinodell / .gitignore
Last active Mar 13, 2017
Standard Magento .gitignore
View .gitignore
# Don't include any temporary files and other unimportant things
*.log
*.bak
*.bak.*
*.thumbs/
.DS_Store
Thumbs.db
.svn
*.swp
@colinodell
colinodell / checker.php
Created Oct 24, 2014
Google Inbox invite checker
View checker.php
<?php
$last = '';
while (true) {
$json = file_get_contents('https://www.reddit.com/r/google/comments/2k0kjr/google_inbox_invite_chain.json?sort=new&foo='.rand(1,500));
$json = json_decode($json, true);
$comment = $json[1]['data']['children'][0];
$msg = $comment['data']['author'] . ' - ' . $comment['data']['body'] . "\n";
if ($msg != $last) {
View keybase.md

Keybase proof

I hereby claim:

  • I am colinodell on github.
  • I am colinodell (https://keybase.io/colinodell) on keybase.
  • I have a public key whose fingerprint is 8FBC 987A 0483 128A C055 E483 60A4 DAD2 72A0 1CB8

To claim this, I am signing this object:

View console.js
// Super-simple console script to push the button only when the timer gets low
var h;
var armed = false;
var lowestSoFar = 9999999999;
h = setInterval(function() {
if (r.thebutton._msLeft <= 0) {
console.log('Game over :-/');
clearInterval(h);
return;
View rateLimit.js
// Returns a function that won't fire more than
// once every `wait` milliseconds.
//
// Example usage:
//
// $('.button').click(rateLimit(function(){
// console.log('clicked!');
// }));
//
function rateLimit(func, wait) {
@colinodell
colinodell / AbstractEnum.php
Created Aug 18, 2015
Enum-like class for PHP
View AbstractEnum.php
<?php
/**
* Base class used to build enums
*/
abstract class AbstractEnum
{
/**
* @var array Options array, suitable for a select box
*/
@colinodell
colinodell / create-multiple.sh
Created Aug 20, 2015
Create Drupal upgrade patches
View create-multiple.sh
#!/bin/bash
# A sample script for batch-creating multiple patches at once
# Generate 6.x patches
for i in `seq 0 36`
do
./create-patch.sh 6.$i 6.37
done
# Generate 7.x patches
@colinodell
colinodell / services.yml
Created Aug 20, 2015
Guzzle with logger
View services.yml
services:
guzzle.client:
class: Guzzle\Http\Client
calls:
- [addSubscriber, ["@guzzle.logger"]]
guzzle.logger:
class: Guzzle\Log\MonologLogAdapter
arguments:
- "@logger"
@colinodell
colinodell / portVarKeywords.php
Last active Sep 28, 2016 — forked from nikic/portAlternativeTags.php
Tool for changing "var" keywords to "public" in PHP
View portVarKeywords.php
<?php
/*
* Note: This script will directly modify the .php files in the given directory.
* It is assumed that the code is under version control, so you can easily review
* the changes using `git diff` or similar.
*/
function usageError() {
die("Usage: php portVarKeywords.php dir/\n");
@colinodell
colinodell / ParagraphDirProcessor.php
Created Mar 10, 2016
Adding 'dir' attribute to all paragraphs (UNTESTED)
View ParagraphDirProcessor.php
<?php
// TODO: Set your "namespace" and "use" statements here
// Also see this documentation: http://commonmark.thephpleague.com/customization/abstract-syntax-tree/#document-processor
class ParagraphDirProcessor implements DocumentProcessorInterface
{
public function processDocument(Document $document)
{
$walker = $document->walker();
You can’t perform that action at this time.