Skip to content

Instantly share code, notes, and snippets.

@kamranzafar
kamranzafar / toast.js
Created July 18, 2012 14:40
JQuery Mobile Android-style Toast popup
var toast=function(msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })
@cowsrule
cowsrule / KOTemplateCache.js
Last active December 17, 2015 16:59
A simple plugin for knockout.js that caches DOM nodes created for named templates. Knockout JS Template Cache
define(['ko'],
function (ko) {
var self = { };
var cachedTemplatesDomDataKey = "__cached_template__";
//
// When rendering a template, a source is what returns either the text or the already-created DOM
// nodes to clone. The default implementation of a template source in knockout doesn't cache the
// DOM nodes that it creates, and instead requests the text of the <script> tag the template is
@hobbyquaker
hobbyquaker / germanHolidays
Last active August 29, 2015 13:57
Deutsche Feiertage 2013-2019 im JSON Format - konvertiert aus https://gist.github.com/grmlin/5508185
{"BW":{"20130106":"Heilige Drei Könige","20130329":"Karfreitag","20130331":"Ostersonntag","20130401":"Ostermontag","20130501":"1. Mai","20130509":"Christi Himmelfahrt","20130519":"Pfingstsonntag","20130520":"Pfingstmontag","20130530":"Fronleichnam","20131003":"Tag der deutschen Einheit","20131101":"Allerheiligen","20131225":"Erster Weihnachtsfeiertag","20131226":"Zweiter Weihnachtsfeiertag","20140101":"Neujahr","20140106":"Heilige Drei Könige","20140418":"Karfreitag","20140420":"Ostersonntag","20140421":"Ostermontag","20140501":"1. Mai","20140529":"Christi Himmelfahrt","20140608":"Pfingstsonntag","20140609":"Pfingstmontag","20140619":"Fronleichnam","20141003":"Tag der deutschen Einheit","20141101":"Allerheiligen","20141225":"Erster Weihnachtsfeiertag","20141226":"Zweiter Weihnachtsfeiertag","20150101":"Neujahr","20150106":"Heilige Drei Könige","20150403":"Karfreitag","20150405":"Ostersonntag","20150406":"Ostermontag","20150501":"1. Mai","20150514":"Christi Himmelfahrt","20150524":"Pfingstsonntag","20150525":"
@arudmin
arudmin / syncthing
Last active June 8, 2019 17:44
/etc/init.d/syncthing script for Raspberry Pi (or any Ubuntu/Debian)
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.