Skip to content

Instantly share code, notes, and snippets.

"append_commit_sha": "sed -i \"s+</html+<!-- ${CI_COMMIT_SHORT_SHA} --></html+g\" ./dist/index.html"
@jenovs
jenovs / parser.js
Created September 23, 2019 18:26
Add query param to the link
const parser = (str, time) => {
if (!time) {
return str;
}
const re = /src="([^"]+)"/;
const match = re.exec(str);
if (!match) {
return str;
@jenovs
jenovs / restful.md
Created November 19, 2018 08:49
RESTful routes
Name Path Verb Description
Index /article GET list articles
New /article/new GET show create_new form
Create /article POST create new, redirect
Show /article/:id GET show one article
Edit /article/:id/edit GET show edit form
Update /article/:id PUT update article, redirect
Delete /article/:id DELETE delete article
@jenovs
jenovs / kindle_hack.js
Created August 16, 2018 17:37
Enable dictionaries on Kindle online reader
// https://learnoutlive.com/german-english-dictionary-kindle-cloud-reader/
javascript: (function() {
/* based on ACRExtensions via https://github.com/binarycrafts/ACRExtensions */
var w = null;
var kDoc = null;
var kObj = null;
if (typeof window.KindleReaderContextMenu !== 'undefined') {
w = window;