Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Maciej Mionskowski maciekmm

🎯
Focusing
Block or report user

Report or block maciekmm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maciekmm
maciekmm / gist:5b6c0e3955c36f8efc752b5e5bc52ee5
Created Apr 12, 2019
/etc/X11/xinit/xinitrc.d/10-monitors.sh
View gist:5b6c0e3955c36f8efc752b5e5bc52ee5
#!/bin/sh
#TODO: fetch and calculate DPI from EDID data
internal=eDP1
internal_dpi=128
external=HDMI1
external_dpi=92
export SCALING_FACTOR=1
View gist:d2b2af8ccc1708fc32e490b9cca4f7be
BSP_LCD_SelectLayer(0);
srand(time(NULL));
for (int i = 0; i < 3; i++) {
BSP_LCD_SetTextColor((((uint32_t) rand()) & 0x00FFFFFF) + 0xFF000000);
int x1 = rand() % LCD_X_SIZE;
int x2 = rand() % LCD_X_SIZE;
int y1 = rand() % LCD_Y_SIZE;
int y2 = rand() % LCD_Y_SIZE;
int xl = min(x1, x2);
int xr = max(x1, x2);
View mikro.c
static void lcd_start(void)
{
/* LCD Initialization */
BSP_LCD_Init();
/* LCD Initialization */
BSP_LCD_LayerDefaultInit(0, (unsigned int)lcd_image_bg);
BSP_LCD_LayerDefaultInit(1, (unsigned int)lcd_image_fg);
/* Enable the LCD */
@maciekmm
maciekmm / purge_cache.php
Created Jun 7, 2017
Cloudflare cache purging script meant to be attached to github repo via a page_built webhook.
View purge_cache.php
<?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);
View Facebook Sidebar Defader.user.js
// ==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 / 73-wyniki.txt
Created Mar 8, 2017
Zbiór zadań: 73, 79
View 73-wyniki.txt
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 %)
View gist:3decc9443f1834454d80

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 / dispatcher.go
Last active Jan 1, 2016
Event dispatcher
View dispatcher.go
package events
import (
"fmt"
"reflect"
"sync"
)
type Event interface {
Clone() Event
@maciekmm
maciekmm / bashorg.py
Created Nov 2, 2015
bash.org python script for displaying bash.org quotes on desktop. XKCD here: https://gist.github.com/maciekmm/3868d531d081b51f6e52
View bashorg.py
#!/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 Aug 8, 2015
Extracts from values by parsing html page
View extract_form_values.go
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
You can’t perform that action at this time.