Skip to content

Instantly share code, notes, and snippets.

View ip413's full-sized avatar
🇵🇱

ip413 ip413

🇵🇱
View GitHub Profile
@ip413
ip413 / nvmlink
Created May 13, 2024 10:31 — forked from MeLlamoPablo/nvmlink
Creates a symlink to /usr/bin/node after using nvm
@ip413
ip413 / Wayland.md
Created March 29, 2022 06:39 — forked from probonopd/Wayland.md
Boycott Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

tl;dr: Wayland is not ready as a 1:1 compatible Xorg replacement just yet, and maybe never will. Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better of not using Wayland at this point.

Wayland solves no issues I have but breaks almost everything I need. And usually it stays broken, because the Wayland folks only seem to care about Gnome, and alienating everyone else in the process. DO NOT INSTALL WAYLAND! Let Wayland not destroy everything and then have other people fix the damage it caused. Or force more Red Hat/Gnome components (glib, Portals, Pipewire) on everyone!

Please add more examples to the list.

Wayland breaks screen recording applications

#!/bin/sh
# Imagemagick analogue of Adobe Photoshop Gradient map with 75% opacity on it
# you will need the input.jpg file with original color image
# and gradient_line.png file with 256 x 1 px image of gradient
# make image grayscale
convert input.jpg -colorspace gray draft.jpg
# apply the gradient lut
@ip413
ip413 / read_arguments.js
Last active May 29, 2021 17:13 — forked from ishu3101/read_arguments.js
Accept input via stdin and arguments in a command line application in node.js
#!/usr/bin/env node
main();
function main() {
const usageMsg = 'Usage: ...\n';
// If no STDIN and no arguments
if (process.stdin.isTTY && process.argv.length <= 2) {
process.stderr.write(usageMsg);
@ip413
ip413 / oneliners.js
Created February 23, 2021 10:23 — forked from ghostcode/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@ip413
ip413 / attractors.py
Created February 20, 2021 22:03 — forked from ylegall/attractors.py
code for animating strange attractors in blender
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians
from utils.interpolation import *
from easing_functions import *
frame_start = 1
total_frames = 120
@ip413
ip413 / 50_lines.pde
Created May 6, 2020 12:48 — forked from u-ndefine/50_lines.pde
Sketch of my generative art, "50 Lines"
float decel(float x) { // as an easing function
return 1-(x-1)*(x-1);
}
void setup() {
background(255);
size(750,750,P2D);
PImage img = loadImage("image.png");
strokeWeight(2);
noFill();
@ip413
ip413 / AccessDump.py
Created May 30, 2017 09:14 — forked from mywarr/AccessDump.py
use mdbtools to convert .mdb to .sqlite and .csv
#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import sys, subprocess, os
DATABASE = sys.argv[1]
@ip413
ip413 / static_server.js
Last active July 6, 2016 20:26 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);