Skip to content

Instantly share code, notes, and snippets.

var fs = require('fs');
var file = __dirname + '/test.json';
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
console.log('Error: ' + err);
return;
}
data = JSON.parse(data);
@wookiecooking
wookiecooking / install-php5+nginx.sh
Created May 17, 2013 03:37 — forked from spolu/install-php5+nginx.sh
[Ubuntu] Install PHP5 and NGINX
sudo apt-get install nginx
sudo apt-get install spawn-fcgi
apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
@wookiecooking
wookiecooking / h5bp-twitter-bootstrap
Last active December 17, 2015 10:39 — forked from paulirish/h5bp-twitter-bootstrap
[Bootstrap] Shell script to quickly setup a project using html5boilerplate and twitter bootstrap
#!/bin/sh
echo "
Cool, let's start.
"
src=$PWD
@wookiecooking
wookiecooking / handle_file_upload.php
Created May 17, 2013 03:23 — forked from ebidel/handle_file_upload.php
[PHP] File Upload + Form
<?php
$fileName = $_FILES['afile']['name'];
$fileType = $_FILES['afile']['type'];
$fileContent = file_get_contents($_FILES['afile']['tmp_name']);
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent);
$json = json_encode(array(
'name' => $fileName,
'type' => $fileType,
'dataUrl' => $dataUrl,
@wookiecooking
wookiecooking / gist:5596758
Last active December 17, 2015 10:39 — forked from eric1234/gist:4384588
[PHP] Check PHP for errors
find ./ -name \*.php | xargs -n 1 php -l
#
# File compressor plugin for jekyll
# =================================
#
# By [mytharcher](https://github.com/mytharcher)
# 2012-05-20
#
# Updated by [nicoespeon](https://github.com/nicoespeon)
# 2013-04-12
#

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Welcome!

If you have any suggestions, please leave a comment and mention me ( @dideler ) so I get a notification.
Pull requests aren't possible with gists (yet), so comments are more useful than forking this to make changes.

Don't forget to star this gist!

TODO
  • Organize resources into sections
  • More detailed sections (perhaps sections & subsections)