Skip to content

Instantly share code, notes, and snippets.

@adamwojt
adamwojt / matrixlock.md
Last active November 24, 2021 07:29
cmatrix + alock + awesomewm = matrixlock
let x = null;
document.addEventListener('DOMContentLoaded', init);
window.addEventListener('error', messedUp);
window.addEventListener('steve', anotherFunc);
function init() {
console.log('loaded page', x);
x = 456;
// debugger;
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@CodeDraken
CodeDraken / JS-Essentials-Objects.js
Created October 9, 2018 20:00
Code for JavaScript Essentials: Objects
// Wolf
// - Properties
// -- fur color
// -- eye color
// -- size
// -- gender
// -- age
// - Actions
// -- walk/run
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active April 19, 2026 18:27
Online Resources For Web Developers (No Downloading)
@bradtraversy
bradtraversy / ssh.md
Last active March 16, 2026 17:53
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@bradtraversy
bradtraversy / myscript.sh
Last active February 22, 2026 04:29
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active April 27, 2026 17:02 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@jaredrummler
jaredrummler / FizzBuzz.kt
Created February 24, 2017 12:43
Kotlin FizzBuzz
fun main(args: Array<String>) {
for (i in 1..100) {
println(if (i % 15 == 0) "FizzBuzz" else if (i % 3 == 0) "Fizz" else if (i % 5 == 0) "Buzz" else i)
}
}
@greymd
greymd / Main.java
Created February 10, 2017 05:14
Prime numbers with Java8 Stream API
import java.util.stream.IntStream;
class Main {
public static void main(String args[]) {
IntStream.rangeClosed(2, 100)
.filter(i -> IntStream.rangeClosed(2, (int)Math.sqrt(i))
.allMatch(j -> i%j != 0))
.forEach(n -> {
System.out.println(n);
});