As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
/* | |
A single regex to parse and breakup a full URL including query parameters and anchors e.g. | |
https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash | |
*/ | |
Url.regex = /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/; | |
url: RegExp['$&'], | |
protocol: RegExp.$2, | |
host: RegExp.$3, |
var docmode = document.documentMode; | |
// Does the browser support window.onhashchange? | |
// Note that IE8 running in IE7 compatibility mode reports true for 'onhashchange' in window, | |
// even though the event isn't supported, so also test document.documentMode. | |
if ('onhashchange' in window && (docmode === undefined || docmode > 7 )) { | |
window.onhashchange = checkHash; | |
} | |
// IE7 doesn't support the hashchange event so we fall back to standard polling technique | |
else { |
/* | |
Allows for ajax requests to be run synchronously in a queue | |
Usage:: | |
var queue = new $.AjaxQueue(); | |
queue.add({ | |
url: 'url', |
<?php | |
class HashTable { | |
private $_array = array(); | |
private $_size = 10000; | |
public function __construct($size=0) { | |
$size = (int)$size; | |
if ($size > 0) { |
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["ctrl"], | |
"press_command": "drag_select", |
<?php | |
/** | |
* Creating MongoDB like ObjectIDs. | |
* Using current timestamp, hostname, processId and a incremting id. | |
* | |
* @author Julius Beckmann | |
*/ | |
function createMongoDbLikeId($timestamp, $hostname, $processId, $id) | |
{ |
;[Element].forEach(function(self){ | |
self.prototype.eventListenerList = {}; | |
self.prototype._addEventListener = self.prototype.addEventListener; | |
self.prototype.addEventListener = function(type, handle, useCapture) { | |
useCapture = useCapture === void 0 ? false : useCapture; | |
var node = this; | |
node._addEventListener(type, handle, useCapture); |
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
apt-get update | |
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
mkdir -p /etc/php7/conf.d | |
mkdir -p /etc/php7/cli/conf.d | |
mkdir /usr/local/php7 |