Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / Thesis topics.md
Last active December 23, 2015 11:28 — forked from minivan/Thesis topics
@bumbu
bumbu / tree_parser.coffee
Last active August 29, 2015 13:56
Keys tree parser
'''
Given input
[
"category:subcategory:item1"
, "category:subcategory:item2"
, "category2:item2"
, "category2:item3"
, "item3"
]
@bumbu
bumbu / gh_contributions.js
Created March 16, 2014 14:26
Allows editing of GitHub contributions graph
$('#calendar-graph').clone().attr('id', 'cg2').insertAfter($('#calendar-graph').hide());
$('#cg2 .day').off('click').click(function(ev){
ev.preventDefault()
ev.stopPropagation()
var $this = $(this)
var colors = ['1e6823', '44a340', '44a340', '8cc665', '8cc665', '8cc665', 'd6e685', 'd6e685', 'd6e685', 'd6e685']
if($this.attr('style') == 'fill: #eeeeee;') {
var color = colors[Math.floor(Math.random() * colors.length)]
@bumbu
bumbu / index.html
Last active August 29, 2015 13:57
Pathvisiojs modularisation
<!DOCTYPE html>
<html>
<head>
<title>Pathvisiojs Demos</title>
<script src="./../dist/lib/jquery/js/jquery.min.js"></script>
<script src="pathvisiojs.js"></script>
<script>
$(function(){
$('#path1').pathvisiojs()
$('#path2').pathvisiojs()
@bumbu
bumbu / child.js
Created May 17, 2014 20:18
Conditional module loading in bower
module.exports = function(a){
console.log('child got '+a)
}
@bumbu
bumbu / keybase.md
Created September 30, 2014 11:15
keybase.md

Keybase proof

I hereby claim:

  • I am bumbu on github.
  • I am bumbu (https://keybase.io/bumbu) on keybase.
  • I have a public key whose fingerprint is 1862 7E4B E09A 9C7A 4C59 DF3A 0CDE FA6F 1C55 E48F

To claim this, I am signing this object: