Skip to content

Instantly share code, notes, and snippets.

<?php
global $current_user;
(is_object($current_user) && isset($current_user->user_login)) ? $html = '<input type="hidden" name="current_user" value="' . $current_user->user_login . '" />' : $html = '' ;
$html. = '<input type="submit" value="' . esc_attr( $value ) . '"' . $atts . ' />';
@abrahamvegh
abrahamvegh / .bashrc
Created December 23, 2009 14:58 — forked from stammy/.bashrc
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
http://gigaom.com/2010/01/03/objectified-design/
10 Rules of Good Design by Dieter Rams
1. Good design should be innovative
2. Good design should make a product useful
3. Good design is aesthetic design
4. Good design will make a product understandable
5. Good design is honest
6. Good design is unobtrusive
<?php
class simplenoteapi
{
private $email;
private $token;
private $last_response;
private function socket_request ($http_method, $api_method, $data)
{
$host = 'simple-note.appspot.com';
Howdy,
I have one issue which is rather strange, and one request which is rather not.
Often, when Growl tells me I have a new message, I'll open Notify and tap the spacebar. The preview window will open up, and it'll be blank, with just "(empty body)" displayed.
Since this has happened a number of times, and I can't reproduce it with any specific condition, but it just *happens*, I thought I'd report it and see what you make of it.
The request is rather simple: Make the window move, or stay put.
<?php
function rm_r($input)
{
if (is_file($input))
{
return @unlink($input);
}
else if (is_dir($input))
{
$scan = glob(rtrim($input,'/').'/*');
<?php
/**
* Quick-and-dirty password generator, fully-commented edition ;)
*
* Author: Abraham Vegh <me@abrahamvegh.com>
*/
// Our password generator, with a default length of eight
function random_password ($length = 8)
{
1. How do you put a giraffe into a refrigerator?
Stop and think about it and decide on your answer before you scroll down.
The correct answer is: Open the refrigerator, put in the giraffe, and close the door. This question tests whether you tend to do simple things in an overly complicated way.
2. How do you put an elephant into a refrigerator?
Did you say, Open the refrigerator, put in the elephant, and close the refrigerator?
<?php
function isset_and_is($a,$b,$c){$d=&$GLOBALS['_'.strtoupper($a)];return isset($d[$b])&&$d[$b]==$c;}