Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@tjstein
tjstein / nginx-vhost.conf
Created April 5, 2011 00:47
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?;
}
@adililhan
adililhan / compressor.sh
Created October 12, 2012 22:44
Simple CSS Compressor
#!/bin/bash
# Author: Adil İlhan
files=`find . -name "*.css"`;
for i in $files
do
rmcss=`ls -d $i | sed s/\.css//g`
`cp $i $rmcss".uncompressed.css"`
`sed 's/^\/.*//g;s/^\*.*//g;/ \*/d;s/^[A-Z].*//g' $i > tmp && mv tmp $i`
@mburst
mburst / rss_reader.php
Created March 24, 2013 03:58
RSS Feed Reader in PHP
<html>
<head>
<title>RSS Feed Reader</title>
</head>
<body>
<?php
//Feed URLs
$feeds = array(
"http://maxburstein.com/rss",
"http://www.engadget.com/rss.xml",
@adamloving
adamloving / Gruntfile.coffee
Created July 19, 2013 23:52
The best thing I added to my Gruntfile this week.
SUCCESS_PHRASES = ['all good', 'works for me', 'keep it coming', 'yeah baby', 'i like it',
'you\'re good', 'that\'s it', 'nailed it', 'mmm hmmm', 'sweet', 'keep it up', 'yep']
# ...
exec:
notify_ok:
cmd: ->
phrase = SUCCESS_PHRASES[Math.round(Math.random()*(SUCCESS_PHRASES.length-1))]
"say -v Vicki \"#{phrase}\""

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active May 14, 2024 15:14
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@prwhite
prwhite / Makefile
Last active October 2, 2024 03:13
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@mhemmings
mhemmings / adminer.sh
Created January 30, 2014 22:52
Download Adminer like a boss! Found myself often wanting to quickly put Adminer on a box for a few minutes while I investigated something but couldn't remember the URL. This script downloads Adminer and also has some cool extra functionality, including automatic deletion (see --help for usage)
#!/bin/bash
usage() {
printf "%s\n" "Usage: $0 [-m] [-e] [-o] [-c] [-d]"
printf "\t%s\n\t%s\n\t%s\n\t%s\n" \
"-m MySQL only" "-e English only" "-o Output file" \
"-c CSS file to download" "-d Auto-delete time (minutes)"
exit 1
}