Skip to content

Instantly share code, notes, and snippets.

@snnwolf
snnwolf / nginx-vhost.conf
Created November 19, 2015 20:06 — forked from tjstein/nginx-vhost.conf
nginx vhost config for WordPress + PHP-FPM
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
server_name www.example.com;
rewrite ^ http://example.com$request_uri?;
}
#!/usr/bin/env bash
size=1024 # MB
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@snnwolf
snnwolf / README.md
Created November 11, 2015 21:33 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@snnwolf
snnwolf / gist:d22501563210e42f720f
Created November 3, 2015 21:21
MacPorts (PHP, MySQL, SQLite, Postgres)

Install Apache 2, MySQL 5 and PHP 5 on Mac OS X using MacPorts:

Preparation

  • Install Xcode: Grab it from App Store
  • Install Command line tools in xcode (open xcode -> Preferences -> Downloads -> Command Line tools)
  • Install MacPorts: http://macports.org/install.php.
  • Check MacPorts is installed. This will be a good test to see if MacPorts was installed properly:sudo port -v selfupdate.

If you're interested in how MacPorts works, consider reading the documentation for it here: http://guide.macports.org/.

@snnwolf
snnwolf / nginx.conf
Created October 29, 2015 11:14 — forked from denys281/nginx.conf
Symfony2 nginx virtual host (php-fpm)
server {
listen 80;
# Server name being used (exact name, wildcards or regular expression)
server_name mysite.com;
client_max_body_size 20M;
# Document root, make sure this points to your Symfony2 /web directory
root /home/user/sites/mysite.com/web;
@snnwolf
snnwolf / README
Created October 29, 2015 10:59 — forked from diemuzi/README
Apache 2.2.x / 2.4.x FPM Configuration
This configuration is a working copy which I have tested on Apache 2.2.x and 2.4.x
I highly recommend you use this version of mod_fastcgi as it works with Apache 2.4.x, fastcgi.com version does not!
https://github.com/ByteInternet/libapache-mod-fastcgi
The fastcgi.com version is 2.4.6, the version I am recommending registers as 2.4.7
To patch mod_fastcgi for use with Apache 2.4.x look at the debian/patches folder. It's not specific to Debian OS so don't let that fool you. I personally use Archlinux.
Of course to compile mod_fastcgi:
@snnwolf
snnwolf / a readme.md
Created October 15, 2015 06:54 — forked from Mark-H/a readme.md
modCli; using MODX on the commandline.

modCLI

modCLI is a wrapper for the MODX Revolution Processors, allowing you to pretty much do anything from the commandline that you would normally do within the manager.

To use modCLI, simply download the modcli.php file and put it in the MODX_BASE_PATH of your installation. Next open up the console or terminal, and start firing some commands at it.

Syntax

@snnwolf
snnwolf / .gitignore
Last active October 6, 2015 08:31 — forked from handleman/.gitignore
gitignore for my modx projects
/core/cache/
.DS_Store
*.7z
*.dmg
*.gz
*.rar
*.tar
*.zip
.idea/
config.core.php
<?php
/**
* Pull.php:
* Version control your MODX site using git.
* Pulls changes from git and processes database changes in changesets.
*
* Authors:
* Jeroen Kenters / www.kenters.com
* Bert Oost / www.oostdesign.com
*
var css = 'insert lots of css here';
var files = {};
css = css.replace(/url\(["']?(\S*)\.(png|jpg|jpeg|gif)["']?\)/g, function(match, file, type)
{
var fileName = file + '.' + type;
var size = fs.statSync(fileName).size;
if (size > 4096) {
console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)');
return match;