Skip to content

Instantly share code, notes, and snippets.

View spacemonkey's full-sized avatar
💩
Flinging poo.

Mitch Pirtle spacemonkey

💩
Flinging poo.
  • RevDoc
  • Stamford, CT
View GitHub Profile
@spacemonkey
spacemonkey / PHPFPM.Portfile
Created August 25, 2011 12:59 — forked from jasonmoo/PHPFPM.Portfile
PHP 5.3.8 MacPorts Portfile with FPM enabled FastCGI variant
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 71588 2010-09-17 05:21:24Z ryandesign@macports.org $
PortSystem 1.0
name php5
conflicts php5-devel php52
# Update revision of php5-eaccelerator when updating version of php5
epoch 1
version 5.3.8
@spacemonkey
spacemonkey / php-fpm.conf
Created October 21, 2011 08:01
Stock php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/opt/local). This prefix can be dynamicaly changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
@spacemonkey
spacemonkey / connections.php
Created November 24, 2011 12:22
Example for connecting Lithium apps to a MongoDB replica set
/**
* Example of a production database called "db_prod" connecting to a replica set
* running on two systems, "db1" and "db2" with the replica set name of "prod_01".
*
* This setup assumes that you're running a recent version of MongoDB as well as
* the PHP extension.
**/
Connections::add('default', array(
'production' => array(
'type' => 'MongoDb',
@spacemonkey
spacemonkey / Portfile
Created January 4, 2012 11:02
Portfile for nginx with file upload module, and upload status
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 86786 2011-11-04 05:20:35Z boeyms@macports.org $
PortSystem 1.0
name nginx
version 1.0.8
categories www mail
platforms darwin
license BSD
@spacemonkey
spacemonkey / gist:1875664
Created February 21, 2012 10:25
Portfile for PHP 5.3.10 supporting php-fpm
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89615 2012-02-04 05:28:00Z ryandesign@macports.org $
PortSystem 1.0
name php5
conflicts php5-devel php52
# Keep version of php5 in sync with bundled php5 extension ports.
# Increment revision of php5-eaccelerator when updating version of php5.
epoch 1
@spacemonkey
spacemonkey / add_create_date.php
Created July 4, 2013 10:07
This is a simple PHP script that solves the common problem of folks forgetting to add created_at (MongoDate) to all of their documents. This script will get a list of your collections and loop through them, only updating documents that are missing a created_at property; and these are fixed by pulling the date out of the _id object, and convertin…
<?php
/**
* add_create_date.php by Spacemonkey
* https://gist.github.com/spacemonkey
*
* Loops through all collections in a mongodb database,
* finds all documents that are missing a created_at property
* and extracts it from _id and updates the document.
*
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/hoodie-server/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/hoodie-start/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/hoodie.admin/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/hosted-git-info/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/htmlescape/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/htmlparser2/package.json
npm verb installManyTop reading scoped package data from /Users/spacemonkey/code/hoodie/my-first-hoodie/node_modules/http-errors/package.json
npm verb installManyTop
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/opt/nvm/versions/node/v5.4.0/bin/node',
1 verbose cli '/usr/local/opt/nvm/versions/node/v5.4.0/bin/npm',
1 verbose cli 'start' ]
2 info using npm@3.3.12
3 info using node@v5.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle my-first-hoodie@~prestart: my-first-hoodie@
6 silly lifecycle my-first-hoodie@~prestart: no script for prestart, continuing
7 info lifecycle my-first-hoodie@~start: my-first-hoodie@

Keybase proof

I hereby claim:

  • I am spacemonkey on github.
  • I am spacemonkey (https://keybase.io/spacemonkey) on keybase.
  • I have a public key ASA7NXiXlKtnN4Xh0-aXATB7FCNHAkCZaLBjIWETQWUmaQo

To claim this, I am signing this object:

@spacemonkey
spacemonkey / advent-linkage.md
Last active December 2, 2018 18:19
List of Advent of Code websites for 2018. Happy to accept PR's and additions/corrections. Enjoy!

Advent of Code, 2018 Edition

Here's a curated list of Advent of Code events for the 2018 holiday season. This is a living list, all PR's are welcome (and encouraged).

Wha?

An Advent of Code is like an advent calendar for nerds. First you might want to know what an Advent Calendar is - the TL;DR is it is normally a paper calender where there is a small treat hidden behind a perforated opening for each day in the month of December, leading up to the 25th. For our purposes though, instead of a physical calendar with candies, we get a coding challenge for each day - a great way to work some coding muscles and get exposed to new ways of writing software.

These calendars normally kick off on December 1, and each day presents a new challenge or task. Some of the websites in this list will not update until December 1, so this list may also grow extremely quickly just before the month of December kicks off.