- Update
package.json
, setversion
to a prerelease version, e.g.2.0.0-rc1
,3.1.5-rc4
, ... - Run
npm pack
to create package - Run
npm publish <package>.tgz --tag next
to publish the package under thenext
tag - Run
npm install --save package@next
to install prerelease package
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
import json | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
from selenium.webdriver.chrome.options import Options | |
def process_browser_log_entry(entry): | |
entry["message"] = json.loads(entry["message"])["message"] | |
return entry |
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
String.prototype.padLeft = function (n, str) { | |
if (n < String(this).length) { | |
return this.toString(); | |
} | |
else { | |
return Array(n - String(this).length + 1).join(str || '0') + this; | |
} | |
} | |
function crc16(s) { |
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
# long | |
docker run --rm -ti \ | |
--publish <container port>:<exposed port> \ | |
--env <env>=<val> \ | |
--volume <local path>:<mounted path> \ | |
<repo>/<image>:<tag> | |
# short | |
docker run --rm -ti \ | |
-p <container port>:<exposed port> \ |
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
// Thanks to MoOx and martindafonte over at | |
// https://gist.github.com/MoOx/93c2853fee760f42d97f | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), | |
description: element.getAttribute("aria-label"), | |
// using style.backgroundColor might returns "rgb(...)" |
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
#!/bin/sh | |
# Printing PDF files from your command prompt. | |
# 1. Create a "print" folder in your home directory. | |
# 2. Put this "print.sh" in the "print" folder. | |
# 3. Run "chmod +x print.sh" to make me executable | |
# 4. For each time you want to print PDF files: | |
# i) Place a copy of the PDF files in the "print" folder | |
# ii) run "./print.sh" |
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
// The mathematical definition (i.e. simple recursion): | |
function fib(n) { | |
if (n < 1) { // base case 1 | |
return 0; | |
} | |
if (n < 3) { // base case 2 | |
return 1; | |
} | |
// recursion steps |
This guide shows how to set up a bidirectional client/server authentication for plain TLS sockets.
Newer versions of openssl are stricter about certificate purposes. Use extensions accordingly.
Generate a Certificate Authority:
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
%This is a basic English-to-Prolog translator. It uses a | |
%pathfinding algorithm to find the meaning of each sentence. | |
%For example, output([a,is,greater,than,B],X) means X = (a > b). | |
%The input is an English phrase. The output is a Prolog expression. | |
output(Input,Output) :- | |
is_output(Output), | |
means(Input,Output). |
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
/** | |
* MAKE ELECTRON APP FEEL MORE NATIVE | |
* | |
* * Prevent dragging all HTML elements, specially: | |
* - images | |
* - links (anchors) | |
* | |
* * Prevent text selection | |
*/ |
NewerOlder