Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂

Alexander K. J. Schmidt Bloggerschmidt

🙂
View GitHub Profile
View one-million-passwords-list.txt
This file has been truncated, but you can view the full file.
123456
password
12345678
qwerty
123456789
12345
1234
111111
1234567
@Bloggerschmidt
Bloggerschmidt / languages.sql
Created May 15, 2021
SQL dump of common languages of the world
View languages.sql
CREATE TABLE `common_languages` (
`id` int(11) NOT NULL,
`language_code` varchar(10) NOT NULL,
`language_name` varchar(100) NOT NULL,
`status` varchar(255) NOT NULL DEFAULT 'draft'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `common_languages` (`id`, `language_code`, `language_name`, `status`) VALUES
(1, 'af', 'Afrikaans', ''),
@Bloggerschmidt
Bloggerschmidt / continents.sql
Created May 13, 2021
SQL insert of continents incl. short codes
View continents.sql
CREATE TABLE `common_continents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL DEFAULT '',
`name` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into common_continents (code,name) values ('AF','Africa');
insert into common_continents (code,name) values ('AN','Antarctica');
insert into common_continents (code,name) values ('AS','Asien');
@Bloggerschmidt
Bloggerschmidt / ch-kantone.sql
Last active May 13, 2021
SQL insert of swiss states aka Kantone incl. short codes
View ch-kantone.sql
CREATE TABLE `common_ch_kantone` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL DEFAULT '',
`name` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into common_ch_kantone (code,name) values ('AG','Aargau');
insert into common_ch_kantone (code,name) values ('AR','Appenzell Ausserrhoden');
insert into common_ch_kantone (code,name) values ('AI','Appenzell Innerrhoden');
@Bloggerschmidt
Bloggerschmidt / us-states.sql
Created May 13, 2021
SQL insert of us states incl. short codes
View us-states.sql
CREATE TABLE `common_us_states` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL DEFAULT '',
`name` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into common_us_states (code,name) values ('AL','Alabama');
insert into common_us_states (code,name) values ('AK','Alaska');
insert into common_us_states (code,name) values ('AS','American Samoa');
@Bloggerschmidt
Bloggerschmidt / de-bundeslaender.sql
Created May 13, 2021
SQL insert of german states aka Bundesländer incl. short codes
View de-bundeslaender.sql
CREATE TABLE `common_de_bundeslaender` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL DEFAULT '',
`name` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into common_de_bundeslaender (code,name) values ('BW','Baden-Württemberg');
insert into common_de_bundeslaender (code,name) values ('BY','Bayern');
insert into common_de_bundeslaender (code,name) values ('BE','Berlin');
@Bloggerschmidt
Bloggerschmidt / useDarkMode.js
Created Apr 14, 2021
custom react hook - get system prefered theme and use it
View useDarkMode.js
const matchDark = '(prefers-color-scheme: dark)'
function useDarkMode() {
const [isDark, setIsDark] = React.useState(
() => window.matchMedia && window.matchMedia(matchDark).matches
)
React.useEffect(() => {
const matcher = window.matchMedia(matchDark)
const onChange = ({ matches }) => setIsDark(matches)
@Bloggerschmidt
Bloggerschmidt / useClickOutside.js
Created Apr 14, 2021
custom react hook - when clicking outside of an element -> do something
View useClickOutside.js
function useClickOutside(elRef, callback) {
const callbackRef = React.useRef()
callbackRef.current = callback
React.useEffect(() => {
const handleClickOutside = e => {
if (elRef?.current?.contains(e.target) && callbackRef.current) {
callbackRef.current(e)
}
@Bloggerschmidt
Bloggerschmidt / terminal-git-branch-name.md
Created Feb 18, 2021 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Linux/Mac)
View terminal-git-branch-name.md

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
View uBlacklist.txt
*://www.amazon.de/*
*://www.amazon.com/*
*://www.facebook.com/*
*://www.ebay.com/*
*://www.microsoft.com/*
*://www.apple.com/*
*://www.instagram.com/*
*://www.wikipedia.org/*
*://www.t-online.de/*
*://www.bild.de/*