Skip to content

Instantly share code, notes, and snippets.

@jamesbar2
jamesbar2 / postal-codes.json
Last active April 30, 2024 16:15 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 30, 2024 16:14
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@jrk
jrk / README.md
Last active April 30, 2024 16:10
Executable script to run Quartz filters on a PDF file from the shell

This is a simple, should-be-drop-in replacement for the old /System/Library/Printers/Libraries/quartzfilter utility which went away circa OS X 10.8.

Usage:

chmod +x quartzfilter.js
./quartzfilter.js infile.pdf filter.qsfilter outfile.pdf

e.g.,

./quartzfilter.js my-big-pdf.pdf "/System/Library/Filters/Reduce File Size.qfilter" my-less-big-pdf.pdf

@zhnlk
zhnlk / gdfsi-2015.txt
Created October 31, 2017 11:05
Google Dorks For SQL Injection
inurl:trainers.php?id=
inurl:buy.php?category=
inurl:article.php?ID=
inurl:play_old.php?id=
inurl:declaration_more.php?decl_id=
inurl:pageid=
inurl:games.php?id=
inurl:page.php?file=
inurl:newsDetail.php?id=
inurl:gallery.php?id=
@brutella
brutella / go-modules.md
Created December 7, 2018 12:57
Go modules

Go supports modules since v1.11+.

Go modules require that GOPATH is empty => unset GOTPATH

Define a module

Run go mod init {module name} to create a go.mod file for the current directory.

For example go mod init github.com/brutella/dnssd creates the following content.

@LittleNewton
LittleNewton / settings.jsonc
Last active April 30, 2024 16:08
Visual Studio Code 个人配置
/*
* Author: 刘鹏
* Description: 个人 VScode 配置文件
* Create Date: 2020, Apr. 12
* Update Date: 2021, Nov. 6
* Email: littlenewton6@gmail.com
*/
@gjerokrsteski
gjerokrsteski / remove env file from git forever
Last active April 30, 2024 16:08
remove env file from git history forever
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master
@stephen-peck
stephen-peck / README.md
Created September 7, 2017 15:58
Forking and patching npm modules from a monorepo

Forking and patching npm modules from a monorepo

Commonly, npm modules are source controlled using a single dedicated repo for each module. When forking and patching such an existing npm module, typical approaches are either:

  • reference a specific git commit in your forked repo
    "dependencies": {
        "patchedmodule": "git+https://github.com/myuser/patchedmodule.git#mypatch"
    }
@alfredringstad
alfredringstad / README.md
Created September 25, 2017 13:26
Forking a single package in a monorepo

Forking a single package in a monorepo

The trend of using monorepos makes a lot of things easier to manage. However, when you want to fork a single package inside a monorepo, you'll have to chose one of two options:

  • Fork the entire monorepo (meaning you get all those extra boilerplate you don't really care about)
  • Manually copying the package files into a new git repo (meaning you'll loose all git history and have a lot of work to do when there's a new version of your base package)

The good news: There's a solution for this! And it's actually built in to git.

git subtree

One of the lesser-known (and vaguely documented) features of git is subtree. It's intended for this purpose, working as a great alternative to the criticized submodules. There are very few resources about using this in practice, so here's a guide for this specific use case.

@Klerith
Klerith / react-index.html
Created May 6, 2020 19:07
Introducción a React
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- Cargat React -->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>