Skip to content

Instantly share code, notes, and snippets.

View maciekmm's full-sized avatar
🎯
Focusing

Maciej Mionskowski maciekmm

🎯
Focusing
View GitHub Profile
package net.maciekmm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class Drawer {
public enum Clazz {
@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

@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 / 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 / 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 / dispatcher.go
Last active January 1, 2016 16:17
Event dispatcher
package events
import (
"fmt"
"reflect"
"sync"
)
type Event interface {
Clone() Event

layout: post title: "Using Google Apps Scripts for a simple backend" date: 2016-01-30 18:00:00 +0100 tags:

  • google
  • apps
  • go categories:
  • go
@maciekmm
maciekmm / 73-wyniki.txt
Created March 8, 2017 14:47
Zbiór zadań: 73, 79
73.1 Słów z dwoma kolejnymi takimi samymi literami:
204
73.2 Statystyka:
A: 632 (7.55 %)
B: 196 (2.34 %)
C: 162 (1.94 %)
D: 422 (5.04 %)
E: 1093 (13.06 %)
F: 213 (2.55 %)
// ==UserScript==
// @name Facebook Sidebar Defader
// @namespace https://mionskowski.pl/
// @version 0.1
// @description Increases readability of the chat sidebar
// @author Maciej Mionskowski
// @match https://*.facebook.com/*
// @grant GM_addStyle
// ==/UserScript==
@maciekmm
maciekmm / purge_cache.php
Created June 7, 2017 07:09
Cloudflare cache purging script meant to be attached to github repo via a page_built webhook.
<?php
error_reporting(0);
define("CF_ZONE_ID", "");
define("CF_EMAIL", "");
define("CF_API_KEY", "");
define("GH_SECRET", "");
if($_SERVER['REQUEST_METHOD'] !== 'POST') {
error_log("Invalid request (expected POST)");
http_response_code(400);