If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| <!-- Old Github.tmTheme --> | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <!-- | |
| ====================================================================== | |
| Github | |
| ====================================================================== | |
| A Sublime Text 2 / Textmate theme. | |
| Copyright (c) 2012 Dayle Rees. | |
| Released under the MIT License <http://opensource.org/licenses/MIT> |
| <!-- SQL.tmLanguage --> | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>fileTypes</key> | |
| <array> | |
| <string>sql</string> | |
| <string>ddl</string> | |
| <string>dml</string> |
| import "fmt" | |
| func Type(args ...interface{}) string { | |
| return fmt.Sprintf("%T", args[0]) | |
| } | |
| func Dump(args ...interface{}) { | |
| fmt.Println(args...) | |
| } |
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
| <?php | |
| function foo(bool $x = true) { var_dump($x); } | |
| ?> | |
| Fatal error: Default value for parameters with a class type hint can only be NULL in /var/www/... on line 2 | |
| <?php | |
| // what the fuck? :) | |
| define('None', ''); | |
| define('True', true); |
| <?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] | |
| )) { |
| - | |
| 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 |
| <?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 = []; |
| <?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)) { |
| 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; | |
| } |