git branch -d (the_local_branch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringExtensions | |
{ | |
public static string ToTitleCase(this string value) | |
{ | |
return System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase( | |
value.ToLowerInvariant()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ArrayHelper { | |
const PARENT_NODE = "<return></return>"; | |
private function __construct() { } | |
public static function arrayToXml($array, &$xml) { | |
foreach($array as $key => $value) { | |
if(is_array($value)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ObjectHelper { | |
private function __construct() { } | |
public static function toArray($obj) { | |
if (is_object($obj)) { | |
$obj = get_object_vars($obj); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getIpAddress() { | |
foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { | |
if (array_key_exists($key, $_SERVER) === true) { | |
foreach (explode(',', $_SERVER[$key]) as $ip) { | |
$ip = trim($ip); | |
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { | |
return $ip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function parseRawHttpRequest(array &$arrayData) { | |
$input = file_get_contents('php://input'); | |
preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches); | |
if (!count($matches)) { | |
// parse_str(urldecode($input), $arrayData); | |
parse_str($input, $arrayData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class StatusCodes { | |
const HTTP_100 = 'HTTP/1.1 100 Continue'; | |
const HTTP_101 = 'HTTP/1.1 101 Switching Protocols'; | |
const HTTP_200 = 'HTTP/1.1 200 OK'; | |
const HTTP_201 = 'HTTP/1.1 201 Created'; | |
const HTTP_202 = 'HTTP/1.1 202 Accepted'; | |
const HTTP_203 = 'HTTP/1.1 203 Non-Authoritative Information'; | |
const HTTP_204 = 'HTTP/1.1 204 No Content'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
final class DebugHelper { | |
/** | |
* @param object $data | |
* @param string $name | |
* @param boolean $jsEval | |
* @return string | |
*/ | |
public static function logConsole($data, $name = null, $jsEval = false) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Collections; | |
class ArrayCollection { | |
private $elements; | |
public function __construct(array $_elements = array()) { | |
$this->elements = $_elements; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.center = function () { | |
this.css("position","fixed"); | |
this.css("top", ($(window).height() / 2) - (this.outerHeight() / 2)); | |
this.css("left", ($(window).width() / 2) - (this.outerWidth() / 2)); | |
return this; | |
} |
OlderNewer