- Package Control
- Package Resource Viewer
- Old Github Theme
- BracketHighlighter
- EasyDiff
- DocBlokr
- Git (https://github.com/kemayo/sublime-text-git)
This file contains hidden or 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
String.prototype.format = function() { | |
var string = this.toString(); | |
if (arguments.length) { | |
var tokens = string.match(/%([sdf])/g) || [], | |
token, i = 0, replace; | |
while (token = tokens.shift()) { | |
replace = arguments[i++]; | |
switch (token) { | |
case "%d": | |
string = string.replace(token, parseInt(replace, 10) || 0); |
This file contains hidden or 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
# delete a remote tag | |
git tag -d theTagName | |
git push origin :refs/tags/theTagName |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>html</string> | |
<string>htm</string> | |
<string>shtml</string> | |
<string>xhtml</string> |
This file contains hidden or 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
var Class = (function() { | |
return { | |
create: function(prototype){ | |
function Class() { | |
if (this.init && this.init.apply) { | |
this.init.apply(this, arguments); | |
} | |
} | |
Class.prototype = prototype; | |
Class.prototype.constructor = Class; |
This file contains hidden or 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 | |
$url = "https://foo.com//bar/////ii?a=1"; | |
$url = preg_replace("~(?<!:)/+~", "/", $url); | |
print($url); # https://foo.com/bar/ii?a=1 |
This file contains hidden or 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
$str = <<<EOT | |
Lorem [a href="#"]ipsum[/a] [hr color="red" /] dolor... | |
[style].foo{color:#fff}[/style] | |
EOT; | |
function bbcode_convert($content) { | |
// remove style|script | |
$content = preg_replace( | |
'~(\[(style|sctript)\s?.*\](.*)\[/(\\2)\]|\[(%s)\s?.*/\])~ims', '', $content); |
This file contains hidden or 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
<VirtualHost *:80> | |
ServerName foo.com.local | |
DocumentRoot /var/www/foo.com/public | |
<Directory /var/www/foo.com/public> | |
Options +FollowSymLinks | |
DirectoryIndex index.php | |
AllowOverride all | |
Require all granted | |
This file contains hidden or 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
function extract_array_path($path, $value = null, $base = null) { | |
if ($base === null) { | |
static $base = array(); | |
} | |
$exp = explode('.', $path); | |
$tmp =& $base; | |
foreach($exp as $i) { | |
$tmp =& $tmp[$i]; | |
} |
This file contains hidden or 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
// Handles also array params well | |
function parseQueryString(query) { | |
var pars = (query != null ? query : "").replace(/&+/g, "&").split('&'), | |
par, key, val, re = /^([\w]+)\[(.*)\]/i, ra, ks, ki, i = 0, | |
params = {}; | |
while ((par = pars.shift()) && (par = par.split('=', 2))) { | |
key = decodeURIComponent(par[0]); | |
// prevent param value going to be "undefined" as string | |
val = decodeURIComponent(par[1] || "").replace(/\+/g, " "); |