Skip to content

Instantly share code, notes, and snippets.

View elementbound's full-sized avatar

Tamás Gálffy elementbound

View GitHub Profile
@sethprog26
sethprog26 / proj.cpp
Created May 6, 2021 21:27
Project From Ademitan Akinlade-Fajemirokun
#include <iostream>
#include <string>
using namespace std;
void printRules() {
cout << "Rules:\n"
<< " * The player who has three horizontally adjacent pieces, loses\n"
<< " * The player who has three vertically adjacent pieces, loses\n"
<< " * The player who has three diagonally adjacent pieces, loses\n"
@ef4
ef4 / examples.md
Last active June 22, 2024 19:32
Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.

So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.

List of polyfill packages that were used in webpack 4

For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback.

@somahargitai
somahargitai / ThingsMakeMeMad.MD
Last active July 19, 2024 09:38
My universal IT complainer surface

I just complain here

This is a complainer surface to show the world the dark side of my real-life developer experience

content
  • Things software engineers say about work
@19h47
19h47 / COMMAND.md
Last active January 23, 2018 03:10
Command

cd

The cd command is used to change the current directory.

cd stand for change directory

cd path/of/directory
@saitoha
saitoha / suckless-st-sixel.diff
Last active June 15, 2024 15:52
Add SIXEL graphics support for suckless st. (sixel.c/sixel_hls.c come from mintty, licensed under GPL)
commit ea830e03d4d4562b1ff225940f65bceddd9cad6c
Author: Hayaki Saito <saitoha@me.com>
Date: Sun Jun 11 23:46:45 2017 +0900
Add sixel graphics support
Signed-off-by: Hayaki Saito <saitoha@me.com>
diff --git a/Makefile b/Makefile
index d8595fe..a25d040 100644
abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@dfrankland
dfrankland / checkered.css
Created August 25, 2016 21:30
CSS Checkered pattern that can be used on all modern browsers.
body {
background-image:
linear-gradient(45deg, #ccc 25%, transparent 25%),
linear-gradient(135deg, #ccc 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #ccc 75%),
linear-gradient(135deg, transparent 75%, #ccc 75%);
background-size:25px 25px; /* Must be a square */
background-position:0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */
}
Canidae
Felidae
Cat
Cattle
Dog
Donkey
Goat
Guinea pig
Horse
Pig
@joepie91
joepie91 / 00_warning.md
Last active October 5, 2023 21:24
Asynchronous fs.exists

Important warning

You should almost never actually use this. The same applies to fs.stat (when used for checking existence).

Checking whether a file exists before doing something with it, can lead to race conditions in your application. Race conditions are extremely hard to debug and, depending on where they occur, they can lead to data loss or security holes. Using the synchronous versions will not fix this.

Generally, just do what you want to do, and handle the error if it doesn't work. This is much safer.

  • If you want to check whether a file exists, before reading it: just try to open the file, and handle the ENOENT error when it doesn't exist.
  • If you want to make sure a file doesn't exist, before writing to it: open the file using an exclusive mode, eg. wx or ax, and handle the error when the file already exists.
@protrolium
protrolium / ffmpeg.md
Last active July 12, 2024 17:37
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with: