Skip to content

Instantly share code, notes, and snippets.

@morgoth
morgoth / deployer.rake
Created January 27, 2012 20:03
Rake task to copy local files to remote server via FTP
# Rake task to copy local files to remote server via FTP
# required credentials.yml file, that contains keys:
# server, username, password
require "net/ftp"
require "yaml"
class FTPClient
attr_reader :remote_path
@scottkellum
scottkellum / normalized.html
Created December 6, 2011 14:58
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
@mjangda
mjangda / wp-command-line-script.php
Created November 2, 2011 22:12
Simple generic command line script for WordPress
<?php
// Let's load WordPress
require( 'wp-load.php' );
if ( ! function_exists( 'wp' ) )
die( 'Sorry, looks like WordPress isn\'t loaded.' );
// Run the core code for our script
my_command_line_script();
@avalanche123
avalanche123 / Makefile
Created October 18, 2011 23:39
new PHP project Makefile
# Makefile for php project setup
#
# You can set these variables from the command line.
AUTHOR = Author
PROJECT = Project
BUILDFILE = project.phar
SRCDIR = src
TESTDIR = tests
PHPUNITCONFIG = phpunit.xml.dist
@EvilSpaceHamster
EvilSpaceHamster / sps-vhost-template
Created September 11, 2011 14:30
Quick and dirty apache vhost generator
#!/usr/bin/php
<?php
$args = getopt("",array("url:","subdomain:","port::","email::"));
if (!isset($args["subdomain"]))$args["subdomain"]="";
if (!isset($args["url"]))$args["url"]="";
if (!isset($args["email"])){
$args["email"]="info@alisdairrankine.com";
}
@weakish
weakish / README.markdown
Created April 18, 2011 12:07
Bookmark directories in #Bash.

Bookmark directories in Bash.

Install

Source bmark.sh in your ~/.bashrc. (Enableing cdable_vars in Bash makes this script better.)

Usage

@cambiata
cambiata / httpauth.php
Created March 22, 2011 07:09
Basic Http Authentication
<?php
/**
* Attempt to wrap Http Authentication into a separate class...
*
* Ideas and some code from FuelPHP Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
*/
@cambiata
cambiata / rest.php
Created March 22, 2011 07:07
Rest Controller based on Kohana's and FuelPHP's
<?php
/**
* Quickly assemled rest controller based on Kohana 3's Kohana_Controller_REST
* https://github.com/kohana/core/blob/3.1%2Fmaster/classes/kohana/controller/rest.php
*
* Added functionality from FuelPHP's Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
* All credits to Kohana and FuelPHP teams!
* Jonas Nyström - cambiata
@cambiata
cambiata / testrest.php
Created March 22, 2011 07:06
Example controller extended from Controller_Cambiata_Rest
<?php
/**
* Test controller extending Controller_Cambiata_REST
* Jonas Nyström - cambiata
*
* To be used with a route like this one:
*
* Route::set('rest', 'rest(/<par1>(/<par2>(/<par3>(/<par4>(/<par5>)))))(.<format>)')
* ->defaults(array(