Skip to content

Instantly share code, notes, and snippets.

View cebe's full-sized avatar
☁️
working on cebe.cloud

Carsten Brandt cebe

☁️
working on cebe.cloud
View GitHub Profile

Idiot-Proof Git Aliases

@jedi4ever
jedi4ever / gist:898114
Created April 1, 2011 13:06
update jenkins Updatecenter from CLI
$ java -jar jenkins-cli.jar -s http://localhost:9000 install-plugin findbugs
findbugs is neither a valid file, URL, nor a plugin artifact name in the update center
No update center data is retrieved yet from: http://updates.jenkins-ci.org/update-center.json
findbugs looks like a short plugin name. Did you mean 'null'?
# Specifying a full URL works!
$ java -jar jenkins-cli.jar -s http://localhost:9020 install-plugin http://updates.jenkins-ci.org/download/plugins/AdaptivePlugin/0.1/AdaptivePlugin.hpi
# Get the update center ourself
@ashee
ashee / kvm guest - vnc over ssh tunnel.sh
Created April 14, 2011 18:06
How to connect vnc viewer to a kvm guest over ssh tunnel
amitava@bonjovi:~$ sudo virsh
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # start latticegrid-demo
Domain latticegrid-demo started
virsh # list
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@samdark
samdark / gist:1001489
Created May 31, 2011 23:36
Yii: switching theme based on view name
<?php
/**
* Q:
*
* Hi, could please add this feature please. Here is my case, I have two themes
* and I have modules. How can one set each view file in the modules to use
* either one of the themes. Such if the view is admin use backoffice theme and
* if view is index use siteNew theme. I so someting like setBasePath and
* setBaseUrl but I don not know where they should be exactly.
*
@smerrill
smerrill / fix-profile.sh
Created August 2, 2011 21:59
Fix an XDebug 2.1.1 (or later) callgrind file to be usable with XDebugToolkit
#!/bin/bash
[[ $1 ]] || {
echo "Usage: fix-profile.sh [path to callgrind file]"
exit 1
}
egrep -v '^(cfl|positions|creator)' $1 | sed -e 's/^-//;1s/1/0.9.6/' > $1.fixed
@samdark
samdark / HmvcController.php
Created August 3, 2011 22:36
Yii: Simple HMVC
<?php
/**
* Yii, simple HMVC
*/
class HmvcController extends Controller
{
public function actionIndex()
{
echo $this->execute('/hmvc/do/id/123');
}
@cebe
cebe / yiic_bash_completion.bash
Created August 11, 2011 23:19
yiic bash completion
# basic bash completion for yiic command
#
# simply add the following to your ~/.bash_profile
#
# . ~/path/to/this/file/yiic_bash_completion.bash
#
# note: the . is relevant and you probably have to adjust the path ;-)
#
_yiic()
@cebe
cebe / .gitignore
Created August 19, 2011 14:32
script to mirror svn repository
# subversion
.subversion
# mirror dirs
/mirror/*
/tmp/*
@Thinkscape
Thinkscape / PSR-0-final-proposal.md
Created September 22, 2011 10:30
PSR-0 Final Proposal (PHP Standards Working Group)

PSR-0 Final Proposal (PHP Standards Working Group)

The following describes the mandatory requirements that must be adhered to for autoloader interoperability.

Mandatory:

  • A fully-qualified namespace and class must have the following structure \ <Vendor Name> \ (<Namespace>)* \ <Class Name>
  • Each namespace must have a top-level namespace ("Vendor Name").
  • Each namespace can have as many sub-namespaces as it wishes.
  • Each namespace separator is converted to a DIRECTORY_SEPARATOR when loading from the file system.
  • Each "_" character in the CLASS NAME is converted to a DIRECTORY_SEPARATOR. The "_" character has no special meaning in the namespace.