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 | |
namespace Ai; | |
class Facebook | |
{ | |
private $token; | |
public function __construct($token) | |
{ | |
$this->token = $token; |
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 | |
spl_autoload_register('autoloader'); | |
function autoloader($className) | |
{ | |
if(strpos($className, '\\') !== false) { | |
$className = str_replace('\\', DIRECTORY_SEPARATOR, $className); | |
} | |
if(strpos($className, '_') !== 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
#!/bin/bash | |
php doctrine.php orm:generate-entities ~/www/project/data/tmp/ | |
php doctrine.php orm:schema-tool:create --dump-sql > ~/www/project/data/sql/structure.sql | |
php doctrine.php orm:schema-tool:drop --force | |
php doctrine.php orm:schema-tool:create | |
echo 'Inserting database entries' | |
php fixtures.php |
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 | |
class Zend_Form_Element_Country extends Zend_Form_Element_Select | |
{ | |
public function init() | |
{ | |
$_countries = array( | |
"GB" => "United Kingdom", | |
"US" => "United States", | |
"AF" => "Afghanistan", | |
"AL" => "Albania", |
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
<style type="text/css"> | |
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,meter,nav,object,ol,output,p,pre,progress,q,rp,rt,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video,xmp{border:0;margin:0;padding:0;font-size:100%}html,body{height:100%}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}b,strong{font-weight:bold}img{color:transparent;font-size:0;vertical-align:middle;-ms-interpolation-mode:bicubic}li{display:list-item}table{border-collapse:collapse;border-spacing:0}th,td,caption{font-weight:normal;vertical-align:top;text-align:left}q{quotes:none}q:before,q:after{content:'';content:none}sub,sup,small{font-size:75%}sub,sup{line-height:0;position |
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
/* replace variables {{ group.key }} in $content to values from $rep[group][key] array */ | |
$parsed = preg_replace_callback('/{{.([a-z]+\.[a-z]+).}}/i', | |
function($v) use ($rep) { | |
$match = $v[0]; | |
$match = str_replace(' ', '', $match); | |
$match = str_replace('{', '', $match); | |
$match = str_replace('}', '', $match); | |
list($group, $key) = explode('.', $match); | |
return isset($rep[$group][$key]) ? $rep[$group][$key] : $v[0] ; |
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/sh | |
sudo apt-get update | |
sudo apt-get install openjdk-6-jre | |
sudo apt-get install openjdk-6-jdk | |
sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - | |
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' | |
sudo apt-get update | |
sudo apt-get install jenkins | |
sudo apt-get install ant |
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
<target name="stage" depends="build-source"> | |
<property name="remote.user" value="username" /> | |
<property name="remote.address" value="hostname" /> | |
<property name="remote.path" value="~/v_${version}" /> | |
<property name="remote.shared_path" value="~/v_shared" /> | |
<echo message="Deploying project ${ant.project.name} source ${source} to server ${remote.address} ${remote.path}" /> | |
<exec dir="." executable="rsync" failonerror="true"> | |
<arg line="-avPe ssh ${source}/ ${remote.user}@${remote.address}:${remote.path}" /> |
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 file is part of Queue Manager. | |
* | |
* (c) 2011 SparkleBit <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
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/sh | |
killall -9 svnserve | |
svnserve -d -r /var/repositories/ |
OlderNewer