Skip to content

Instantly share code, notes, and snippets.

View jplindgren's full-sized avatar
:octocat:

João Paulo Pozo Lindgren jplindgren

:octocat:
View GitHub Profile
@jplindgren
jplindgren / css-units-best-practices.md
Created January 26, 2023 02:21 — forked from basham/css-units-best-practices.md
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@jplindgren
jplindgren / semantic-branch-names.md
Created January 14, 2023 23:31 — forked from seunggabi/semantic-branch-names.md
semantic-branch-names.md

Semantic Branch Names

See how a minor change to your branch name style can make you a better programmer.

Format: <type>/#<issueNumber>-<alias>

Example

@jplindgren
jplindgren / combinators.js
Created October 24, 2021 15:10 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@jplindgren
jplindgren / Local PR test and merge.md
Created September 10, 2020 15:20 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@jplindgren
jplindgren / how-to-git-patch-diff.md
Last active July 1, 2022 22:28 — forked from nepsilon/how-to-git-patch-diff.md
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff &gt; some-changes.patch
@jplindgren
jplindgren / launch.json
Created May 24, 2020 22:07
Launch.json to debug NestJs Applications.
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Nest App",
"args": [
"src/main.ts"
],
"runtimeArgs": [
@jplindgren
jplindgren / .gitconfig aliases
Created March 19, 2017 23:51
Good aliases for common git commands. Usually .gitignore is at c:/users/myuser in windows.
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
@jplindgren
jplindgren / 00. tutorial.md
Created March 16, 2017 18:43 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@jplindgren
jplindgren / index.html
Created October 20, 2016 03:27 — forked from anonymous/index.html
Example of dinamic populated datalist [Example of dinamic populated datalist] // source https://jsbin.com/zenayababi
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[Example of dinamic populated datalist]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Example of dinamic populated datalist</title>
</head>
<body>
@jplindgren
jplindgren / introrx.md
Created October 8, 2016 15:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing