Skip to content

Instantly share code, notes, and snippets.

View xenji's full-sized avatar

Mario Mueller xenji

  • Mettmann, Germany
  • 07:19 (UTC +02:00)
View GitHub Profile
@xenji
xenji / test.php
Created August 22, 2011 08:05
Code Completion in PDT and other IDEs
<?php
$aObjectStack = array(
new SimpleXMLElement("<html />"),
new SimpleXMLElement("<my_xml />"),
new SimpleXMLElement("<test a='adsf' />"),
);
/**
* In der foreach wuessten wir eigentlich nicht mehr, um
@xenji
xenji / DescribeNewAutoloaderConfiguration.php
Created September 17, 2011 21:00
DescribeNewAutoloaderConfiguration
<?php
namespace ePress\test\Autoloader;
require_once dirname(__FILE__) . '/../../../../../bootstrap.php';
use \Mockery as m;
use \ePress\Impl\Autoloader\DefaultConfiguration;
class DescribeNewAutoloaderConfiguration extends \PHPSpec\Context {
package main
import ("os";"runtime")
func main() {
var aFromList [2]string= [2]string{"/tmp/checkout/folder1_new","/tmp/checkout/folder2_new"}
var aToList [2]string = [2]string{"/var/www/folder1","/var/www/folder2"}
runtime.GOMAXPROCS(2)
c := make(chan int)
# -*- coding: utf-8 -*-
def main():
import MySQLdb
conn = MySQLdb.connect (host="localhost", user="root", passwd="", db="crm")
cursor = conn.cursor ()
cursor.execute ("SELECT usf_id, usf_name FROM adm_user_fields")
aNameRows = cursor.fetchall()
kvMapNames = {}
for aNameRow in aNameRows:
kvMapNames[aNameRow[0]] = aNameRow[1]
package main
import ("os";"runtime")
func main() {
var aFromList [2]string= [2]string{"/tmp/checkout/folder1_new","/tmp/checkout/folder2_new"}
var aToList [2]string = [2]string{"/var/www/folder1","/var/www/folder2"}
runtime.GOMAXPROCS(2)
c := make(chan int)
@xenji
xenji / compile_flags.txt
Created March 7, 2012 11:01
Compile flags for xcache and memcache for php5.4.0
CFLAGS="-D_REENTRANT -D_THREAD_SAFE -O3 -pipe -pthread" CXXFLAGS="-D_REENTRANT -D_THREAD_SAFE -O3 -pipe -pthread" ./configure
Quercus q;
QuercusEngine qce = new QuercusEngine();
qce.getQuercus().init();
FilePath executableFile = new FilePath(cmdLine[7].replace("\"", ""));
// Set the ini path
qce.getQuercus().setIniFile(new FilePath(cmdLine[3]));
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
@xenji
xenji / git_bash_ps1.sh
Created April 3, 2012 14:17
My git bash ps1
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@xenji
xenji / gist:2889392
Created June 7, 2012 15:24
My config.fish
set git_branch_color green
set mycolor 875f5f
function headrev
echo (git log --pretty=%h -n 1)
end
function __git_ps1
set -l g (git rev-parse --git-dir ^/dev/null)
entries = Atom::Feed.load_feed(URI.parse("https://speakerdeck.com/u/xenji.atom"))
base_url = "https://speakerdeck.com"
path = "/oembed.json?url="
@embeds = []
entries.each_entry do |entry|
link = entry.links.alternate.to_s.sub "https", "http"
fullpath = path + CGI.escape(link)
uri = URI.parse(base_url + fullpath)