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 / 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
@jplindgren
jplindgren / Microsoft.PowerShell_profile.ps1
Created June 2, 2016 05:56 — forked from wpsmith/Microsoft.PowerShell_profile.ps1
PowerShell: Profile to always launch PS as Administrator, set Aliases (ex. Notepad++), Import SharePoint Online, Azure AD, and Azure Services.
# Check if Running as Admin
$IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (-not $IsAdmin)
{
if ($MyInvocation.ScriptName -ne "")
{
try
{
Write-Host "Relanuching Script as Admin"
@jplindgren
jplindgren / dev_setup.ps1
Created June 2, 2016 05:54 — forked from thitemple/dev_setup.ps1
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.