Skip to content

Instantly share code, notes, and snippets.

@gbirke
gbirke / callfilter.php.sh
Created April 23, 2010 13:51
Asterisk callfilter
#!/usr/bin/php
<?php
/**
* Error code when file was not found
*/
define('EXIT_NOTFOUND', 11);
require_once 'Console/CommandLine.php';
@gbirke
gbirke / ael.xml
Created August 18, 2010 11:43
jEdit edit mode for Asterisk AEL files
<?xml version="1.0"?>
<!DOCTYPE MODE SYSTEM "xmode.dtd">
<MODE>
<PROPS>
<PROPERTY NAME="lineComment" VALUE="//" />
</PROPS>
<RULES>
function findNewestFile {
FN=`find /srv/www/htdocs -name "$1" -printf "%T+ %p\n" | sort -r | cut -f 2 -d " " | head -n 1`
echo $FN
}
# copy newest robot report config
RR_CONFIG=$(findNewestFile "robotreportconfig.ini")
@gbirke
gbirke / do_call.sh
Created November 9, 2010 13:29
Copy call file template and put it in spool folder
#!/bin/sh
# Copy Asterisk call file template and put it into the default Asterisk call file directory
# Doing just a "cp" may not work in some instances, hence this script
if [ -x "$1" ]; then
echo "Usage: $0 callfile_name"
exit
fi
if [ ! -f "$1" ]; then
echo "File $1 not found"
@gbirke
gbirke / Customer.php
Created December 31, 2010 18:38
Example for default values in Zend_Form
<?php
class Example_Customer {
// Some properties
protected $name = "Joe Schmoe";
protected $street = "1st St NW";
protected $city = "Washington";
protected $zipcode = "20008";
protected $spamLikeThereIsNoTomorrow = true;
@gbirke
gbirke / ctags.cnf
Created March 30, 2011 15:29
ctags navigation for AEL files in jEdit
--langdef=ael
--langmap=ael:.ael
--regex-ael=/context[ \t]+([^ \t]+)[ \t]\{/\1/Contexts/i
--regex-ael=/macro[ \t]+([^ \t]+)[ \t]\{/\1/Macros/i
@gbirke
gbirke / .gitconfig
Last active September 26, 2015 10:27
My default .gitconfig
# You can copy this file to your computer with the following command:
# wget https://gist.github.com/raw/1082842/.gitconfig
[user]
name = Gabriel Birke
email = gb@birke-software.de
[core]
quotepath = false
[color]
ui = auto
[color "branch"]
@gbirke
gbirke / .alias
Last active September 27, 2015 12:08
My default .alias file
# You can copy this file to your computer with the following command:
# wget https://gist.github.com/raw/1267907/.alias
# include in your .bash_profile with "source .alias" or do the following:
# ln -s .alias .bash_aliases
alias ll="ls -al"
alias ..="cd .."
alias ...="cd ../.."
alias pu=pushd
@gbirke
gbirke / array_echo.php
Created October 9, 2011 09:36
PHP-Kurs Codebeispiele
<?php
$hauptstaedte = array("Schweiz" => "Bern",
"Frankreich" => "Paris",
"Deutschland" => "Berlin",
"Spanien" => "Madrid");
// Das geht nicht!!
//echo "Die Stadt heißt $hauptstaedte["Schweiz"]";
@gbirke
gbirke / tree.css
Created February 8, 2012 15:53
jQuery lightweight tree
#container li {
line-height:18px;
}
#container li ins {
display: inline-block;
width:18px;
height:18px;
text-decoration:none;
background-image:url('images/d.png'); // sprite image from jsTree