Skip to content

Instantly share code, notes, and snippets.

View caroillemann's full-sized avatar

Caroline Illemann Hansen caroillemann

  • Manyone
  • Copenhagen, Denmark
View GitHub Profile
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active April 22, 2024 17:13
How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

  1. Install GPG tools
    1. Install GPG tools and setup pin entry by running:
    brew install gnupg pinentry-mac
    mkdir -m 700 -p ~/.gnupg
    echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
    killall gpg-agent
    
@lauripiispanen
lauripiispanen / datalayer-proxy.js
Last active May 25, 2022 14:00
Using ES6 proxies to keep historic data layer state for debug purposes
let dataLayerHistory = []
// this would come from GA
let dataLayer = {
push(obj) {
console.log("pushed to dataLayer", obj)
}
}
// here's our clever little trick...
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active June 25, 2024 13:22
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@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"
    }
@chranderson
chranderson / nvmCommands.js
Last active June 28, 2024 23:08
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@xposedbones
xposedbones / map.js
Last active June 17, 2024 02:30
Javascript Map range of number to another range
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
@hujunfeng
hujunfeng / Root.plist
Last active September 30, 2022 20:40
Add version in Settings.bundle for iOS apps
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>DefaultValue</key>
<string></string>
<key>Key</key>
@paulirish
paulirish / what-forces-layout.md
Last active June 26, 2024 20:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@mbader
mbader / SassMeister-input.scss
Last active January 14, 2021 11:52
Sass Staggered Transition Delay
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@mixin staggered_transitions($nth:1,$items:2,$initial:0,$step:.1){
@for $i from $nth through $items{
&:nth-of-type(#{$i}){
transition-delay:#{$initial}s;
}