Skip to content

Instantly share code, notes, and snippets.

View maciekmm's full-sized avatar
🎯
Focusing

Maciej Mionskowski maciekmm

🎯
Focusing
View GitHub Profile
@maciekmm
maciekmm / dispatcher.go
Last active January 1, 2016 16:17
Event dispatcher
package events
import (
"fmt"
"reflect"
"sync"
)
type Event interface {
Clone() Event
@maciekmm
maciekmm / bashorg.py
Created November 2, 2015 07:59
bash.org python script for displaying bash.org quotes on desktop. XKCD here: https://gist.github.com/maciekmm/3868d531d081b51f6e52
#!/usr/bin/python
import sys
import urllib2
import argparse
from random import randint
import unicodedata as ud
cachePath = '/mnt/data/scripts/bashcache.txt'
@maciekmm
maciekmm / extract_form_values.go
Created August 8, 2015 09:19
Extracts from values by parsing html page
func extractFormValues(reader io.Reader, names []string) (map[string]string, error) {
result := make(map[string]string, len(names))
doc, err := html.Parse(reader)
if err != nil {
return nil, err
}
var rec func(*html.Node)
rec = func(n *html.Node) {
if n.Type == html.ElementNode && n.Data == "input" {
var name, value string
@maciekmm
maciekmm / factorio.log
Created July 20, 2015 10:25
Factorio v12 mod loading crash
0.000 2015-07-20 12:18:53; Factorio 0.12.0 (Build 103, linux64)
0.000 Operating system: Linux
0.000 Read data path: /mnt/data/Software/factorio/data
0.000 Write data path: /mnt/data/Software/factorio
0.000 Binaries path: /mnt/data/Software/factorio/bin
0.454 Graphics options: [FullScreen: true] [VSync: false] [UIScale: 100%] [MultiSampling: X 2] [Graphics quality: normal] [Video memory usage: all]
0.498 Loading mod core 0.0.0 (data.lua)
0.501 Loading mod base 0.12.0 (data.lua)
14.711 Initial atlas bitmap size is 16384
Factorio crashed. Generating symbolized stacktrace, please wait ...
@maciekmm
maciekmm / xkcd.md
Last active September 28, 2017 16:30
Small python script for downloading comic info from xkcd, primarily made for xfce genmon plugin.

With genmon

package net.maciekmm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class Drawer {
public enum Clazz {