Skip to content

Instantly share code, notes, and snippets.

View parasquid's full-sized avatar
💭
Keep Calm and Defy Gravity

Tristan parasquid

💭
Keep Calm and Defy Gravity
View GitHub Profile
@parasquid
parasquid / workflow.md
Last active October 26, 2017 15:03
Branching workflow

When hotfixes need to be applied and deployed to production:

  • Make sure that the hotfix branch is branched off from the production branch and not the development branch.
  • Send a pull request for the production branch. The production branch isn't protected for merges like the development branch, so you can merge them yourself (useful in cases of emergency and no one us there to approve your PR) but if possible, as someone to merge the code for you.
  • Send a pull request to the development branch so the pull request exists in both branches.
  • In case the PR does not merge cleanly with development please branch off from the hotfix branch, fix the merge conflicts, and then merge that into development

Note that the production branch doesn't need to have its own canonical history; only development has that property. This means that in case the production branch becomes fully out of sync with development it is not forbidden to just delete "bad" production branch and just recreate i

# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@parasquid
parasquid / ubuntu-eol.md
Created December 31, 2017 10:06 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]
@parasquid
parasquid / HOWTO.md
Created January 6, 2018 23:03 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@parasquid
parasquid / .block
Last active January 26, 2018 06:36
Film Flowers Petal Starter Code
license: gpl-3.0
@parasquid
parasquid / .block
Created January 26, 2018 07:07
fresh block
license: mit
@parasquid
parasquid / .block
Last active January 26, 2018 08:14
Film Flowers, Single Starter Code
license: gpl-3.0
@parasquid
parasquid / gist:31e1743f122b981511dd74d18c23024e
Last active June 11, 2018 17:02
generate a wgettabl download list of all books in humble bundle
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ|Download)$/i;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim()) && a.attributes['href']) {
downloadCmd += 'wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 20 -c --content-disposition "' + a.attributes['href'].value + "\"\n";
}
}
var output = document.createElement("pre");
@parasquid
parasquid / provision.sh
Last active August 28, 2018 07:47
Script for provisioning a new machine
#!/bin/bash
# initialize sudo
sudo echo
# update and install base packages
sudo apt update
sudo apt -y upgrade
sudo apt install -y git curl gnome-tweaks docker.io build-essential bundler patch ruby-dev \
zlib1g-dev liblzma-dev nodejs chromium-browser npm youtube-dl htop \
@parasquid
parasquid / string-utils.js
Created August 23, 2018 05:54 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str){
return str.toLowerCase();