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 [email protected] $
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 [email protected] $
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 [email protected] $
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.
*
@spacemonkey
spacemonkey / .gitignore
Created July 11, 2014 10:39
.gitignore for Hexo powered websites
.DS_Store
Thumbs.db
db.json
debug.log
node_modules/
public/
.deploy/
themes/
@spacemonkey
spacemonkey / index.php
Created December 4, 2014 18:54
Rudimentary PHP file demonstrating mysqli interface from Bowery AWS instance
<?php
/**
* This file demonstrates connecting and working with a MySQL
* database via mysqli interface, using standard configuration
* provided by Bowery (http://bowery.io).
* If you are wanting to run a totally different stack, you
* are encouraged to do so, and share your setup.
* REMEMBER: You are also free to drop a copy of phpMyAdmin
* right into your app folder, and then you can connect and
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 [email protected]
3 info using [email protected]
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@