Skip to content

Instantly share code, notes, and snippets.

View gr4y's full-sized avatar

Sascha Wessel gr4y

View GitHub Profile
@gr4y
gr4y / dabblet.css
Created February 1, 2012 09:57
do it a little shadowy. experimental stuffz.
/**
* do it a little shadowy. experimental stuffz.
*/
div.with-shadow {
box-shadow: 0 -2px 4px #999;
moz-box-shadow: 0px -2px 4px #999;
o-box-shadow: 0px -2px 4px #999;
webkit-box-shadow: 0px -2px 4px #999;
}
@gr4y
gr4y / dabblet.css
Created January 27, 2012 11:26
table experiment
/**
* table experiment
*/
body {
background: #ECECEC;
min-height:100%;
color: black;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@gr4y
gr4y / dabblet.css
Created January 26, 2012 08:56
have to test something with the white-space css prop.
/**
* have to test something with the white-space css prop.
*/
.normal {
white-space: normal;
}
.nowrap {
white-space: nowrap;
}
var socketUrl = "ws://localhost/socket";
socket = null;
try {
// chrome + safari
socket = new WebSocket(socketUrl);
} catch(e) {
// firefox
socket = new MozWebSocket(socketUrl);
}
NSString *extendedURL = [NSString stringWithFormat:@"oauth/authorize?oauth_token=%@", [requestToken key]];
return getAPIURLWithPath(extendedURL);
@gr4y
gr4y / gist:1184139
Created August 31, 2011 17:34
this dependency tree for the jenkins rake plugin is mindblowing. got the whole maven repository on my machines nao.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Jenkins Rake plugin 1.7.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ rake ---
[INFO] org.jenkins-ci.plugins:rake:hpi:1.7.8-SNAPSHOT
[INFO] +- org.jenkins-ci.main:jenkins-war:war:1.398:test
[INFO] +- org.jenkins-ci.main:jenkins-core:jar:1.398:provided
[INFO] | +- org.jenkins-ci.main:remoting:jar:1.398:provided
/**
* That's why i hate PHP...
*/
private static function method_exists($array){
if(count($array) == 2) return method_exists($array[0], $array[1]);
else throw new Exception("method_exists needs an array with exactly 2 arguments");
}
/*
* Turns out, PHP has this method already. It is called 'is_callable'
@gr4y
gr4y / view.php
Created June 26, 2011 12:59
this creates an nasty zend_mm_heap corrupted message in apache error log and an nice Segmentation fault.
<?php
class View {
/**
* render the view
*/
public function render() {
if($this->vars)
@extract($this->vars);
@gr4y
gr4y / gist:1025708
Created June 14, 2011 19:48
Another reason why PHP sucks: i just wanted to strip the params and the first / in the uri.
private function _resolve_controller_action_array(){
$uri = current( explode('?', server::get('request_uri'), 2) );
$pos = stripos ( $uri, '/' );
$len = strlen ( $uri );
return explode( '/', trim( substr( $uri, $pos + 1, $len ) ) );
}
@gr4y
gr4y / gist:1022530
Created June 13, 2011 09:38
A piece of code I'm not very proud of.
$uri = server::get('request_uri');
$pos = stripos ( $uri, '/' );
$len = strlen ( $uri );
$arr = explode( '/', trim( substr( $uri, $pos + 1, $len ) ) );
a::show($arr);