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 local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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
class TtlCounter { | |
constructor (ttl) { | |
this._count = 0 | |
this._ttl = ttl | |
} | |
get value () { | |
return this._count | |
} |
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
const h = require("highland") | |
const handlebars = require("handlebars") | |
// handlebars wrapper pipeline for gulp object stream | |
const wrapIt = h.pipeline(function (stream) { | |
return h(stream) // wrap node stream into a highland stream | |
// .tap(vinylObject => console.log(vinylObject.path)) | |
.map(function (vinylObject) { | |
const data = vinylObject.contents.toString() // convert marktdown html to string | |
const tpl = fs.readFileSync(tplFile, "utf8") // read handlebars template |
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
#!/usr/bin/env node | |
/////// SORT OBJECT KEYS OF JSON FILE //////////////////////////////////////////////////////////////// | |
// TODO make recursive for object with depth > 1 | |
///////////////////////////////////////////////////////////////////////// | |
const fs = require("fs") | |
const options = "utf8" | |
const file = process.argv[2] |
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
#!/usr/bin/python | |
# diff and merge two files using emacs ediff-mode | |
import os | |
import os.path | |
import sys | |
if len(sys.argv)<3: | |
sys.stderr.write("Usage: ediff file1 file2") | |
else: |
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
fallocate -l 256M /image.img # create file to store a filesystem | |
losetup /dev/loop0 # check if loop0 is free to use, if not continue with loop1, ... | |
losetup /dev/loop0 /image.img # create device using file | |
pvcreate /dev/loop0 # create lvm physical volume | |
vgcreate lvmstorage /dev/loop0 # create volume group "lvmstorage" using device | |
lvcreate -L 128M -n lv1 lvmstorage # create logical volume "lv1" with size 128M | |
mkfs.ext4 /dev/lvmstorage/lv1 # create file system | |
e2label /dev/lvmstorage/lv1 LV1 # set label "LV1" for device | |
mkdir /mnt/stuff | |
mount /dev/lvmstorage/lv1 /mnt/stuff # mount device |