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 / hb links bookmarklet
Last active September 17, 2018 11:16
Generate Humble Bundle wget links (save as a bookmarklet)
@parasquid
parasquid / vagrant.rb
Created September 11, 2018 06:28 — forked from bjjb/vagrant.rb
A Capistrano 3.x Vagrant stage. Place into config/deploy/vagrant.rb, and deploy to the Vagrant box as if it were a production VM.
# Capistrano 3.x Vagrant stage
# config/deploy/vagrant.rb
set :stage, :vagrant
set :rails_env, "production"
vagrant_ssh_config = `vagrant ssh-config`.split("\n")[1..-1].map(&:strip).inject({}) do |m, s|
k, v = s.split(/\s/, 2).map(&:strip); m[k] = v; m
end
@parasquid
parasquid / provision.sh
Created September 1, 2018 14:04
For WSL
GNU nano 2.9.3 provision.sh Modified
#!/bin/bash
# initialize sudo
sudo echo
# update and install base packages
sudo apt update
sudo apt -y upgrade
sudo apt install -y git curl build-essential bundler patch ruby-dev \
@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();
@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 / 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 / .block
Last active January 26, 2018 08:14
Film Flowers, Single 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 06:36
Film Flowers Petal Starter Code
license: gpl-3.0
@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