#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
set :sync_directories, ["public/assets", "public/galleries"] | |
set :sync_backups, 3 |
<?php | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
<?php | |
namespace My\Custom\Doctrine2\Function; | |
/** | |
* RandFunction ::= "RAND" "(" ")" | |
*/ | |
class Rand extends FunctionNode | |
{ | |
public function parse(\Doctrine\ORM\Query\Parser $parser) |
{- Implementation of BST (binary search tree) | |
Script is absolutly free/libre, but with no guarantee. | |
Author: Ondrej Profant -} | |
import qualified Data.List | |
{- DEF data structure -} | |
data (Ord a, Eq a) => Tree a = Nil | Node (Tree a) a (Tree a) | |
deriving Show |
from django.core import serializers | |
import simplejson | |
from django import dispatch | |
from django.core.serializers.json import DateTimeAwareJSONEncoder | |
from django.http import HttpResponse | |
from django.db import models | |
import utils | |
from xml.dom import minidom | |
from django.conf import settings |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#!/usr/bin/env sh | |
## | |
# This is script with useful tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2263406/osx.sh | sh | |
# |
<?php | |
/* From: http://www.php.net/manual/en/function.str-getcsv.php#88773 and http://www.php.net/manual/en/function.str-getcsv.php#91170 */ | |
if(!function_exists('str_putcsv')) | |
{ | |
function str_putcsv($input, $delimiter = ',', $enclosure = '"') | |
{ | |
// Open a memory "file" for read/write... | |
$fp = fopen('php://temp', 'r+'); | |
// ... write the $input array to the "file" using fputcsv()... | |
fputcsv($fp, $input, $delimiter, $enclosure); |
<?php | |
# Nginx don't have PATH_INFO | |
if (!isset($_SERVER['PATH_INFO'])) { | |
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"])); | |
} | |
$request = substr($_SERVER['PATH_INFO'], 1); | |
$file = $request; | |
$fp = @fopen($file, 'rb'); |