Skip to content

Instantly share code, notes, and snippets.

View flavius's full-sized avatar

Flavius Aspra flavius

View GitHub Profile
@FinalDestiny
FinalDestiny / HTTP e stateless.txt
Created August 15, 2011 20:40
soluţiile mele pentru yap-phpro-book (FinalDestiny)
HTTP este un protocol stateless, nu stocheaza datele trimise la fiecare cerere trimisa catre Apache. Fiecare cerere este tratata independent, nedepinzand de oricare alta cerere trimisa anterior. Cum in viitor voi programa aplicatii dinamice, va trebui sa stochez anumite informatii primite de la utilizatori, pentru a genera continut dinamic. Putem stoca informatiile folosind fisiere, baze de date, HTTP cookies.
<?php
return array(
'modules' => array(
'Application',
),
'module_listener_options' => array(
'config_cache_enabled' => false,
'cache_dir' => 'data/cache',
'module_paths' => array(
'./modules',
@starlays
starlays / principiile_open_source.txt
Created April 20, 2012 19:39
Principiile Open Source
Principiile Open Source
<freenode - #yet-another-project>
Initial Release, reviewed by <Lazar Florentin>
Acesta este un document ce are ca scop clarificarea conceptului de Open
Source si a normelor de conduita in cadrul proiectelor Open Source.
Revision History
Revision 1.0 16.09.2011 Revised by: Flavius Aspra
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@snipe
snipe / gist:4256150
Created December 11, 2012 05:38
Apache Ant build.xml file for PHPUnit+Jenkins+Ant+Symfony2
<?xml version="1.0" encoding="UTF-8"?>
<!-- Set some basic project information and targets -->
<project name="My Symfony2 Project" default="build">
<target name="build"
depends="prepare, vendors, dbupdate, fixtures, lint, phploc, phpmd, phpcpd, phpcs, phpunit"/>
<target name="build-parallel"
depends="prepare, vendors, dbupdate, fixtures, lint, tools-parallel, phpcpd, phpunit"/>
anonymous
anonymous / gist:4306435
Created December 16, 2012 11:21
ToggleFlagOptionValue
function! ToggleFlagOptionValue(option, flag)
exe "set " . a:option . eval("&" . a:option . " =~# '" . a:flag . "' ? '-=" . a:flag . "' : '+=" . a:flag . "'")
endfunction
echo &go
call ToggleFlagOptionValue('go', 'T')
call ToggleFlagOptionValue('go', 'r')
echo &go
@oaass
oaass / gist:4577325
Last active December 11, 2015 08:59
<?php
$required = array('hostname', 'username', 'password', 'database', 'driver');
$config = array(
'password' => 'pass',
'database' => 'mydb',
'charset' => 'utf8',
'port' => '1234'
);
$errors = array_diff($required, array_flip($config));
@dahu
dahu / gist:5160260
Created March 14, 2013 10:18
HJKL repetition trap for Vim
" HJKL repetition trap
" Barry Arthur, 2013-03-14
" depends on your :help 'updatetime setting
let g:cursor_moving = 0
function! TrapMovementKeys(key)
augroup CursorMoving
au!
autocmd CursorMoved * let g:cursor_moving = 1
@tiziano88
tiziano88 / gist:5166177
Last active December 14, 2015 23:29
Sane tmux session management for zsh with dynamic session name autocompletion.
function mux {
case "$1" in
"")
# If no args, list all the available "visible" sessions.
tmux ls | grep --color=never -C0 "^[^.]"
;;
*)
# "Hidden" sessions have a name starting with a '.'.
session_id=".$1.`date +%Y%m%d%H%M%S`"
# Try to create a hidden session and attach it to the specified one, killing it once finished.
" HJKL repetition trap
" Barry Arthur, 2013-03-14
" depends on your :help 'updatetime setting
let g:cursor_moving = 0
function! TrapMovementKeys(key)
augroup CursorMoving
au!
autocmd CursorMoved * let g:cursor_moving = 1