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 / provision.ps1
Last active October 16, 2018 19:10
Windows setup
Set-MpPreference -ExclusionPath "$(Resolve-Path '~/')"
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
set-executionpolicy unrestricted -s cu
setx GOPATH %USERPROFILE%\golib;%USERPROFILE%\go
mkdir %USERPROFILE%\golib
mkdir %USERPROFILE%\go
scoop bucket add extras
scoop bucket add java
@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