Skip to content

Instantly share code, notes, and snippets.

Avatar

Paolo Priotto depoulo

View GitHub Profile
@ingmarh
ingmarh / Dockerfile
Created May 14, 2020
CircleCI Build Artifacts server
View Dockerfile
# docker build -t circleci_build_artifacts .
# docker run -it -e CIRCLECI_TOKEN=token --init -p 8091:8091 --name circleci_build_artifacts -d circleci_build_artifacts
FROM hayd/alpine-deno:1.0.0
ENV PORT 8091
EXPOSE $PORT
WORKDIR /app
View undelete_your_private_key.md

So you deleted a private key file and have no backup?

It happened to me in my first IT job. I was told to rm a couple of outdated keyfiles. Of course they weren't named in a human readable manner. And of course I tab-completed to the wrong directory...

AAAAAAAAAAAAHHHH!!!

Of course, there was no such thing as "undelete" on the linux-box in question.

@ericclemmons
ericclemmons / example.md
Last active May 7, 2021
HTML5 <details> in GitHub
View example.md

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
View type.js
function getType (value) {
let type = typeof value;
if (type === 'object') {
return value ? Object.prototype.toString.call(value).slice(8, -1) : 'null';
}
return type;
}
[NaN, 0, 1, Infinity, // numbers
null, undefined, false, 'str', // other primitives
@alexproca
alexproca / docker-machine-rename
Last active Nov 23, 2020
Rename docker-machine
View docker-machine-rename
#!/usr/bin/env bash
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
# Authors
#
# alexproca initial script
# eurythmia sed magic
@staltz
staltz / introrx.md
Last active May 16, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
@gnarf
gnarf / ..git-pr.md
Last active Apr 11, 2021
git pr - Global .gitconfig aliases for Pull Request Managment
View ..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@ronkorving
ronkorving / ios6-timers.js
Last active Dec 22, 2020
iOS6 webkit timer bug workaround
View ios6-timers.js
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is released in the public domain. Do with it what you want, without limitations. I do not promise
// that it works, or that I will provide support (don't sue me).
// Author: rkorving@wizcorp.jp
var timeouts = {};
@hsablonniere
hsablonniere / README.md
Created May 2, 2012
scrollIntoViewIfNeeded 4 everyone!!!
View README.md

scrollIntoViewIfNeeded 4 everyone!!!

This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements.

Usage

Just use the code in index.js in your app or website. You can see usage in the test page test.html.

The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.