- 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
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
<?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
# 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
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
function formatString() { | |
var args = arguments, s = args[0], ms = s.match(/(%s)/g) || [], i = 1, m; | |
while (m = ms.shift()) { | |
s = s.replace(/(%s)/, args[i++]); | |
} | |
return s; | |
} |
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 | |
set_error_handler(function($ecode, $emesg, $efile, $eline) { | |
if (!$ecode || (error_reporting() & $ecode) == 0) { | |
return; | |
} | |
if ($ecode == E_RECOVERABLE_ERROR) { | |
$pattern = '~^Argument (\d)+ passed to (.+) must be '. | |
'(?<type>of the type|an instance of) (?<hint>.+), (?<given>.+) given~i'; | |
if (preg_match($pattern, $emesg, $match)) { |
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 | |
function arguments($limit = null) { | |
$callee =@ debug_backtrace(null, 2)[1]; | |
if (empty($callee)) { | |
throw new \Exception(sprintf( | |
'Could not find callee in %s() funtion!', __function__)); | |
} | |
$return = []; |
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
- | |
if using apache, remove this line in .htaccess if POST'ing to an url | |
like /foo/. it is redirecting first to /foo and cancelling form submit. | |
# Redirect Trailing Slashes... | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
- | |
ensure all dir's are writable like /var/www/foo.com/app/storage/logs/. | |
if yet does not work, create file manually that that guy trying to write | |
like log-apache2handler-2015-04-03.txt |
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 | |
function normalizePostFiles(array $postFiles) { | |
$files = []; | |
if (isset($postFiles['tmp_name']) && is_array($postFiles['tmp_name'])) { | |
foreach ($postFiles['tmp_name'] as $i => $file) { | |
if (isset( | |
$postFiles['name'][$i], $postFiles['type'][$i], | |
$postFiles['size'][$i], $postFiles['error'][$i], | |
$postFiles['tmp_name'][$i] | |
)) { |