Skip to content

Instantly share code, notes, and snippets.

View ip413's full-sized avatar
🇵🇱

ip413 ip413

🇵🇱
View GitHub Profile
#!/bin/bash
# usage-message.sh
if [ $# -eq 0 ]; then
printf "No arguments provided!\n\n"
cat <<EOF
Script accepts three arguments:
- set of characters to generate (more: man tr) (* required)
- number of charaters to generate (* required)
- length of one line (optional, default: value of second argument)
@ylegall
ylegall / attractors.py
Created February 19, 2021 00:24
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
@probonopd
probonopd / Wayland.md
Last active July 26, 2024 20:50
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.VertexElementType
import org.openrndr.draw.renderTarget
import org.openrndr.draw.shadeStyle
import org.openrndr.draw.vertexBuffer
import org.openrndr.draw.vertexFormat
@martinschierle
martinschierle / devtools_vitals.js
Last active June 9, 2020 19:25
JS Snippet to add to devtools to get CLS and LCP data
let po = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
console.log(entry);
}
});
po.observe({type: 'layout-shift', buffered: true});
let po2 = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
@u-ndefine
u-ndefine / 50_lines.pde
Last active June 13, 2024 08:03
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();
@martinschierle
martinschierle / cls.js
Last active August 31, 2022 18:47
Cumulative Layout Shift (CLS) with Puppeteer
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const Good3G = {
'offline': false,
'downloadThroughput': 1.5 * 1024 * 1024 / 8,
'uploadThroughput': 750 * 1024 / 8,
'latency': 40
};
@rivo
rivo / postgres.go
Last active July 7, 2024 14:28
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
@derofim
derofim / ReadMe.md
Created April 23, 2017 15:41
shorten long file names windows

Script tested on Windows 10 64bit.

  1. Install git bash from https://git-for-windows.github.io/
    Git allows to use linux commands on windows.
  2. Open Git Bash Command Line
    Simply right-click on a folder in Windows Explorer to access the BASH or GUI.
    https://git-for-windows.github.io/img/gw1.png
  3. You can use "mv" command to rename "VeryLongFileName.ext" to "shortFileName.ext" like this:
    mv "VeryLongFileName.ext" "shortFileName.ext"
  4. If you need to rename a lot of files in folder use shorten.sh below.
@wojteklu
wojteklu / clean_code.md
Last active July 26, 2024 15:57
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules