Skip to content

Instantly share code, notes, and snippets.

View arbal's full-sized avatar
👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);

Arbal arbal

👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);
  • Los Angeles, CA
  • 04:32 (UTC -07:00)
View GitHub Profile
@arbal
arbal / Notes
Created February 11, 2016 21:16 — forked from robfashiongps/Notes
Typing IP address considered harmful
If a human computer interaction requires the human to type (or copy/paste) an IP address,
those who produced the computer interface have failed to understand the significance of computers.
Computers are tools made by humans for human convenience.
@arbal
arbal / brew cask install --all
Created July 30, 2019 04:56 — forked from michahell/brew cask install --all
brew cask reinstall everything
brew cask install --force $(brew cask list)
@arbal
arbal / phoronix-cmd.md
Created February 12, 2020 00:20 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@arbal
arbal / get_title_and_url.applescript
Created May 8, 2020 21:53 — forked from vitorgalvao/Get Title and URL.applescript
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Google Chrome
tell application "Google Chrome" to return title of active tab of front window
tell application "Google Chrome" to return URL of active tab of front window
-- Google Chrome Canary
@arbal
arbal / ask.sh
Created May 21, 2020 19:23
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://djm.me/ask
local prompt default reply
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"

progrium/bashstyle

Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne

@arbal
arbal / install.sh
Last active February 6, 2021 01:52 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@arbal
arbal / docker-compose.yml
Created June 24, 2020 18:38 — forked from gereltod/docker-compose.yml
example_docker_compose
version: '2'
services:
hello_world:
image: ubuntu
command: [/bin/echo, 'Hello world']
@arbal
arbal / install_ruby_rpi.sh
Created June 28, 2020 18:45 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.6 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.6 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Welcome message
@arbal
arbal / osx_automount_nfs.md
Created July 9, 2020 17:47 — forked from L422Y/osx_automount_nfs.md
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service