Skip to content

Instantly share code, notes, and snippets.

@talhasch
talhasch / hivemind-update.sh
Last active December 14, 2020 08:48
hivemind update script
#!/bin/bash
cd /root/hivemind/
git pull
python3 setup.py build
python3 setup.py install --user
@feruzm
feruzm / docker-cleanup-resources.md
Created September 26, 2017 04:28 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@sean-hill
sean-hill / Hide Splashscreen in Ionic App
Last active April 16, 2017 17:25
Hide Splashscreen in Ionic App with ngCordova
Hide Splashscreen in Ionic App
@tamr
tamr / detranslit.js
Last active February 21, 2017 06:30
detransliterate (latin to cyrillic)
detransliterate = (
function() {
var d = /\t+/g,
rus = "щ щ ш ч ц ю ю я я ё ё ж ъ ъ ы э э а б в г д е з и й й й к л м н о п р с т у ф х х ь ь".split(d),
eng = "shh w sh ch cz yu ju ya q yo jo zh `` '' y e` e' a b v g d e z i j i` i' k l m n o p r s t u f x h ` '".split(d);
return function(str) {
var i,
s = /[^[\]]+(?=])/g, orig = str.match(s),
t = /<(.|\n)*?>/g, tags = str.match(t);
@brynner
brynner / LocalStorageExpires.js
Last active October 20, 2020 18:51
My solution to set a local cache with expiration, using HTML5 LocalStorage. This dramatically increases the performance of a mobile application.
/* Author: Brynner Ferreira (brynner.net) */
// Functions
function removeHtmlStorage(name) {
localStorage.removeItem(name);
localStorage.removeItem(name+'_time');
}
function setHtmlStorage(name, value, expires) {
if (expires==undefined || expires=='null') { var expires = 3600; } // default: 1h
var date = new Date();
var schedule = Math.round((date.setSeconds(date.getSeconds()+expires))/1000);