Skip to content

Instantly share code, notes, and snippets.

// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: check;
"use strict";
/**
* Widget to get a Todoist task based on a filter
* If a filter has multiple sections, will get a random task from first section that has tasks
* The script remembers last selected task, and keeps showing that task while it matches above
* condition (being part of first section with tasks).
@bumbu
bumbu / commit-msg.js
Created April 10, 2017 14:54
A script to prepend JIRA tag to the commit message based on branch name. Run from commit-msg git hook.
#!/usr/bin/env node
import * as fs from 'fs';
const JIRA_TAG = 'TAG';
/* If message title:
* * Doesn't start with square brackets []
* * Doesn't start with Merge branch
* * Doesn't start with Merge pull request
@bumbu
bumbu / Cytoscape.js - Adding compound element on the fly
Created June 13, 2013 08:13
Cytoscape.js - Adding compound element on the fly
$("#button").click(function(){
var list = cy2.filter(function (i, ele) {
return (parseInt(ele.id().slice(1), 10) % 2 === 0);
});
var nodes = [];
// Create new parent
nodes.push({group: "nodes", data: {id: "n0"}, position: {x: 0, y: 0}});
// Create copies of old nodes
@bumbu
bumbu / sensors.py
Created August 18, 2018 19:46
Temperature sensor that controls a relay
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
import sys
import Adafruit_DHT
RELAY_OFF = GPIO.LOW
RELAY_ON = GPIO.HIGH
@bumbu
bumbu / microsoft-flow-todoist-2.json
Created July 23, 2018 21:28
Microsoft flow for Todoist with dependent tasks
{
"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{
"logicAppName":{
"type":"String",
"metadata":{
"description":"Name of the logic app."
}
},
@bumbu
bumbu / microsoft-flow-todoist.json
Created July 23, 2018 21:16
Microsoft flow for Todoist (changing the priority of next item in a project when a task is completed)
{
"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"parameters":{
"logicAppName":{
"type":"String",
"metadata":{
"description":"Name of the logic app."
}
},
@bumbu
bumbu / Thesis topics.md
Last active December 23, 2015 11:28 — forked from minivan/Thesis topics
@bumbu
bumbu / Dispatcher.php
Last active December 21, 2015 01:09
Front page links in admin of Prestashop 1.5.x
<?php
// override/classes/Dispatcher.php
class Dispatcher extends DispatcherCore
{
public static $controllerType = null;
public function getInstanceCustom($controllerType = 'public') {
self::$controllerType = $controllerType;
@bumbu
bumbu / wm.exchanger.ru data collection
Created March 25, 2013 13:00
Script that gathers data from wm.exchanger.ru. More info here http://wm.exchanger.ru/asp/rules_xml.asp I was running it using a cron job every 3 minutes.
import urllib2
from datetime import date, datetime
import os
# ########################################################
# Definitions
# ########################################################
DIRECTORY = 'ADD HERE OUTPUT DIRECTORY'
@bumbu
bumbu / GMTs of Russia's biggest cities
Created February 6, 2013 18:50
GMT крупных городов России
Абакан 8
Альметьевск 4
Ангарск 9
Арзамас 4
Армавир 4
Артем 4
Архангельск 4
Астрахань 4
Ачинск 8
Балаково 4