This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ|Download|Supplement)$/i; | |
var nodes = document.getElementsByTagName('a'); | |
var downloadCmd = "#!/bin/sh\n"; | |
for (i in nodes) { | |
var a = nodes[i]; | |
if (a && a.text && pattern.test(a.text.trim()) && a.attributes['href'] && a.attributes["href"].value != "#") { | |
var link = a.attributes['href'].value; | |
var filename = link.split("?")[0].split("https://dl.humble.com/")[1]; | |
downloadCmd += 'wget -O ' + filename + ' --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 20 -c --content-disposition "' + link + "\"\n"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starts postgres | |
docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres | |
# starts postgres with timescaledb | |
docker run --name timescaledb -e POSTGRES_PASSWORD=postgres -p 5432:5432 timescale/timescaledb:1.0.0-pg10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/cask-fonts" | |
tap "homebrew/core" | |
brew "autoconf" | |
brew "automake" | |
brew "coreutils" | |
brew "libyaml" | |
brew "readline" | |
brew "docker-compose" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7zip (v:19.00) [main] | |
arduino (v:1.8.10) [extras] | |
audacity (v:2.3.2) [extras] | |
firefox (v:70.0) [extras] | |
git (v:2.23.0.windows.1) [main] | |
hugo-extended (v:0.59.0) [main] | |
kicad (v:5.1.4_1) [extras] | |
nodejs (v:13.0.1) [main] | |
nvm (v:1.1.7) [main] | |
openssh (v:7.6p1) [main] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://forum.arduino.cc/index.php?topic=441428.0 | |
#include "TinyWireS.h" | |
#define I2C_SLAVE_ADDR 0x25 | |
#include "SoftwareSerial.h" | |
const int Rx = 3; // this is physical pin 2 - you do not need to connect this to DFPlayer | |
const int Tx = 4; // this is physical pin 3 - connect to RX pin on DFPlayer | |
SoftwareSerial mySerial(Rx, Tx); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = (1..100).map do |num| | |
return "fizzbuzz" if num % 3 == 0 && num % 5 == 0 | |
return "fizz" if num % 3 == 0 | |
return "buzz" if num % 5 == 0 | |
num | |
end | |
puts array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the condition checks if we're running inside rake assets:precompile | |
if !defined?(::Rake::SprocketsTask) | |
FOG_DIRECTORY = begin | |
# try and see if the directory exists | |
FOG_CONNECTION.directories.get(bucket_name) | |
rescue Excon::Error::Forbidden | |
# otherwise let's just create it | |
FOG_CONNECTION.directories.create( | |
key: bucket_name, | |
public: false, |