Skip to content

Instantly share code, notes, and snippets.

View magicznyleszek's full-sized avatar
🤦‍♂️
Watching my hand

Leszek Pietrzak magicznyleszek

🤦‍♂️
Watching my hand
View GitHub Profile
@magicznyleszek
magicznyleszek / my-dev-setup.md
Last active May 24, 2021 22:29
My dev setup
@magicznyleszek
magicznyleszek / git.md
Last active June 10, 2021 06:40
Git Cheatsheet
@magicznyleszek
magicznyleszek / javascript-vs-jquery.md
Last active November 30, 2021 17:50
Vanilla JavaScript

Vanilla JavaScript

Some vanilla equivalents to jQuery methods.

DOM selectors

jQuery:

@magicznyleszek
magicznyleszek / regex.md
Last active March 4, 2022 20:57
RegEx Cheatsheet
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@magicznyleszek
magicznyleszek / random-non-overlapping-position.js
Last active April 11, 2022 21:37
JavaScript -- get random non-overlapping position
// declarations
var positions = [];
// Returns a random integer between min (included) and max (excluded)
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
// generate random positions
@magicznyleszek
magicznyleszek / smutnyleszek-conkyrc
Created March 29, 2014 10:30
Crunchbang Conky configuration
# --------------------------------------------------
# Conky configuration
# Author: Leszek Pietrzak <smutnyleszek@gmail.com>
# Web: http://leszekpietrzak.com
# --------------------------------------------------
# --------------------------------------------------
# Settings
# --------------------------------------------------
@magicznyleszek
magicznyleszek / hex-to-rgb.js
Last active August 22, 2022 11:42
Hex to RGB
function hexToRgb(hex) {
// Expand shorthand form ("#FFF") to full form ("#FFFFF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
// return hex values
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
@magicznyleszek
magicznyleszek / google-search-variables.md
Last active October 30, 2023 22:30
Google Search Variables

Google Search Variables

If you forgot about any of these terms, go to the Advanced Search page and be happy.

Words-related

Either/or -- search for pages containing any of phrases

@magicznyleszek
magicznyleszek / LC_COLORS.md
Created April 5, 2016 13:10 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black