This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /*mongodb custom php session handler | |
copyright 2010 ryan day | |
lgpl | |
*/ | |
$mongo = new Mongo(); | |
//MongoSession::setConfig('collection','session_test'); | |
$mongo_session = new MongoSession($mongo); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// General | |
button_tile_map : true, | |
editor_selector : 'lg_mceEditor', | |
mode:'textareas', | |
theme : 'advanced', | |
// Cleanup/Output | |
apply_source_formatting : true, | |
convert_fonts_to_spans : true, | |
convert_newlines_to_brs : false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "thor/shell" | |
say("Modifying a new Rails app ...", :yellow) | |
#---------------------------------------------------------------------------- | |
# Configure | |
#---------------------------------------------------------------------------- | |
=begin | |
unless options[:database] == 'sqlite3' | |
username = ask("What's your database username[root]") | |
username = 'root' if username.blank? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libjpeg8-dev libmysqlclient-dev | |
curl -O http://www.php.net/get/php-5.3.5.tar.gz/from/a/mirror | |
curl -O http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.17.tar.gz | |
tar zxf httpd-2.2.17.tar.gz | |
cd httpd-2.2.17 | |
./configure --prefix=/etc/apache2 --enable-so --enable-cgi --enable-info --enable-rewrite \ | |
--enable-speling --enable-usertrack --enable-deflate --enable-ssl --enable-mime-magic \ | |
--enable-dav --enable-vhost-alias --enable-proxy --enable-expires --enable-headers | |
make && sudo make install | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
file_put_contents( 'progress.txt', '' ); | |
$targetFile = fopen( 'testfile.iso', 'w' ); | |
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); | |
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' ); | |
curl_setopt( $ch, CURLOPT_FILE, $targetFile ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* GET /posts {"controller":"posts","action":"index"} | |
* GET /posts/{:id:\d+} {"controller":"posts","action":"show"} | |
* GET /posts/add {"controller":"posts","action":"add"} | |
* PUT /posts {"controller":"posts","action":"create"} | |
* GET /posts/{:id:\d+}/edit {"controller":"posts","action":"edit"} | |
* POST /posts/{:id:\d+} {"controller":"posts","action":"update"} | |
* DELETE /posts/{:id:\d+} {"controller":"posts","action":"delete"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Place this file in the webroot of your project, | |
* access it through http://project.dev/tests.php or http://localhost/project/webroot/tests.php | |
* | |
* Assuming you have defined a BASEPATH to the root of your project and | |
*/ | |
define('BASEPATH', __DIR__.'/..'); // root of project, this one assumes /project/webroot/tests.php | |
define('LOCATION', BASEPATH .'/app'); // in a SF2 project, this is where the phpunit.xml file is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/init.d/gearman-workers | |
### BEGIN INIT INFO | |
# Provides: gearman-workers | |
# Required-Start: $network $remote_fs $syslog | |
# Required-Stop: $network $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
OlderNewer