Skip to content

Instantly share code, notes, and snippets.

View mihael's full-sized avatar
👁️
.

Miha Plohl mihael

👁️
.
View GitHub Profile
@mihael
mihael / settings.js
Created October 28, 2020 09:46
persistent settings for Svelte
// A writable settings/data store backed by localStorage
import { writable } from 'svelte/store'
const createWritableStore = (key, startValue) => {
const { subscribe, set } = writable(startValue)
return {
subscribe,
set,
useLocalStorage: () => {
const json = localStorage.getItem(key)

Keybase proof

I hereby claim:

  • I am mihael on github.
  • I am kitschmaster (https://keybase.io/kitschmaster) on keybase.
  • I have a public key whose fingerprint is D3A8 9359 CE28 A576 D6C8 4A59 1BE6 4567 3D13 5CC0

To claim this, I am signing this object:

@mihael
mihael / kdatetime.js
Created February 4, 2015 11:08
KendoUI DateTimePicker for X-Editable
//kendo datetime picker for x-editable
(function ($) {
"use strict";
var KendoDateTimePicker = function (options) {
this.init('kendodatetimepicker', options, KendoDateTimePicker.defaults);
//try parse config defined as json string in data-datetimepicker
options.datetimepicker = $.fn.editableutils.tryParseJson(options.datetimepicker, true);
@mihael
mihael / kdate.js
Last active August 29, 2015 14:14
KendoUI DatePicker for X-Editable
//kendo date picker for x-editable
(function ($) {
"use strict";
var KendoDatePicker = function (options) {
this.init('kendodatepicker', options, KendoDatePicker.defaults);
//try parse config defined as json string in data-datepicker
options.datepicker = $.fn.editableutils.tryParseJson(options.datepicker, true);
#!/usr/bin/env ruby
require 'active_support/time'
require 'ice_cube'
#monthly on the 1st
rule = IceCube::Rule.monthly.day_of_month(1)
#UTC
utc_start = Time.new(2002, 10, 1, 4, 55, 0, "+00:00")
s_UTC = IceCube::Schedule.new(utc_start)
@mihael
mihael / gitsis.rb
Created December 22, 2012 11:36 — forked from anonymous/gitsis.rb
#a simple gitosis-admin/* interface
#used at http://kitschmaster.com for managing Gitosis
module Gitsis
def save_changes(msg, config)
c_msg = `cd #{File.dirname(config)}; git commit -am '#{msg}'`
p_msg = `cd #{File.dirname(config)}; git push origin master`
"GITSIS:\n#{c_msg}\n#{p_msg}"
end