Skip to content

Instantly share code, notes, and snippets.

View kacpak's full-sized avatar

Mateusz Kasprzak kacpak

View GitHub Profile
@kacpak
kacpak / manga-sites-image-highlighter.js
Last active June 3, 2022 17:19
Gives background to images to recognise what is still loading to not miss pages
// ==UserScript==
// @name See loading manga images
// @namespace Violentmonkey Scripts
// @match *://*/*
// @grant none
// @version 1.0
// @author Mateusz Kasprzak
// @downloadURL https://gist.githubusercontent.com/kacpak/ec403a5ee39df48fddaaa5e9b3df1e95/raw
// ==/UserScript==
// ==UserScript==
// @name Request Mocker
// @description Edit this script to mock requests on you site (also edit @match)
// @match *://*/*
// @grant none
// @version 1.0
// @author Mateusz Kasprzak
// @require https://unpkg.com/msw@0.20.4/lib/umd/index.js
// ==/UserScript==
@kacpak
kacpak / spotlight-images-save.bat
Last active July 16, 2018 16:18
Saves Bing spotlight images from lockscreen
node spotlight-images-save.js
@kacpak
kacpak / setup.md
Created August 25, 2017 09:50 — forked from chris-jamieson/setup.md
Set up Franz for Ubuntu
  • Download Franz for your distribution from MeetFranz.com
  • change into the same directory as the downloaded file, then sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz
  • (optional) wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franz
  • (optional) sudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktop

paste the following lines into the file, then save the file:

[Desktop Entry]
Name=Franz
Comment=
@kacpak
kacpak / kacpak.zsh-theme
Created August 20, 2017 23:27
~/.oh-my-zsh/custom/themes/kacpak.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
rvm_current() {
rvm current 2>/dev/null
}
rbenv_version() {
rbenv version 2>/dev/null | awk '{print $1}'
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OperatoryKrzyzowania
{
class Program
{
@kacpak
kacpak / Algorytm.cs
Created March 18, 2017 15:13
Algorytm ewolucyjny funkcji G2
using System;
using System.Collections.Generic;
using System.Linq;
using static G2.Problem;
namespace G2
{
internal static class Algorytm
{
private const int WielkośćPopulacji = 50;
const message = 'alamaworek';
const key = 'blablabla';
function encode(message, key) {
const shift = key
.repeat(Math.ceil(message.length / key.length))
.split('')
.map(c => c.charCodeAt(0) - 'a'.charCodeAt(0));
return message
@kacpak
kacpak / chartjs01.js
Last active February 25, 2017 20:04
Custom Chart.js demo chart
const originalData = [
{ name: 'Bank 1', balance: -50, currency: 'EUR', date: '2012-12-01', image: 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@kacpak
kacpak / clock.js
Last active February 25, 2017 20:06
Watch
// zmienne
var canvas, ctx;
var clockImage;
var startDate;
function clear() {
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
}
function drawClock(date, x, y, width, height, city) {