Skip to content

Instantly share code, notes, and snippets.

View cobyism's full-sized avatar
🤌

Coby Chapple cobyism

🤌
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cobyism on github.
  • I am cobyism (https://keybase.io/cobyism) on keybase.
  • I have a public key ASC_DegBn7CbCydRF-0Y8Fk9Vnu_A_OGt1kQqI4Q0B0_2Qo

To claim this, I am signing this object:

@cobyism
cobyism / cask-finder.rb
Last active December 14, 2019 09:19
Search /Applications for apps that can be installed with `brew cask` (see http://caskroom.io)
#!/usr/bin/env ruby
exact_matches = {}
partial_matches = {}
no_matches = []
puts "Searching /Applications for things that exist in cask…"
Dir.glob('/Applications/*.app').each do |app|
app_name = File.basename(app)
search_term = File.basename(app, ".*").downcase.split(/\s/)[0]
@cobyism
cobyism / digital-ocean-swap.sh
Created June 27, 2015 07:25
Commands to create swapfile on a Digital Ocean Ubuntu droplet
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -s
free -m
@cobyism
cobyism / diy-cardboard-laptop-stand.md
Created February 4, 2013 15:26
DIY Cardboard Laptop Stand

DIY Cardboard Laptop Stand

DSCF0319

Here’s how to make your own laptop stand out of cardboard.

Ingredients

  • One piece of cardboard, approximately 53cm wide x 14cm high (cut up an old parcel box or something).
  • Scissors

== Development Approaches

Asshole Driven development (ADD) - Any team where the biggest jerk makes all the big decisions is asshole driven development. All wisdom, logic or process goes out the window when Mr. Asshole is in the room, doing whatever idiotic, selfish thing he thinks is best. There may rules and processes, but Mr. A breaks them and people follow anyway.

Cognitive Dissonance development (CDD) - In any organization where there are two or more divergent beliefs on how software should be made. The tension between those beliefs, as it's fought out in various meetings and individual decisions by players on both sides, defines the project more than any individual belief itself.

Cover Your Ass Engineering (CYAE) - The driving force behind most individual efforts is to make sure than when the shit hits the fan, they are not to blame.

Development By Denial (DBD) - Everybody pretends there is a method for what's being done, and that things are going ok, when in reality, things are a mess and the proces

@cobyism
cobyism / hexagate.svg
Last active January 21, 2022 15:42
For anyone who isn’t able to access this New Feature™ of Twitter due to the usual Nation-state Region-centric Nonsense™ and wants to join the hex club, this is a SVG mask path similar to Twitter’s hexagonal NFT PFP implementation, except rotated 30º, because… Think Different?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cobyism
cobyism / rpi-vnc-on-boot.md
Last active September 18, 2022 14:18
How to set up a Raspberry Pi so that VNC starts on boot. Mostly from http://myraspberrypiexperience.blogspot.co.uk/p/setting-up-vnc.html

Starting VNC automatically on a Raspberry Pi

sudo apt-get install tightvncserver
vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565
  • Set up a password for access (optional)
sudo vi /etc/init.d/tightvncserver
@cobyism
cobyism / emojibomb.rb
Last active December 25, 2022 03:48
Generate a random emoji bomb via the command-line
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
# Run `emojibomb` to get three emoji.
# Run `emojibomb N`, where `N` is a positive integer to get N emoji.
response = open("http://www.emoji-cheat-sheet.com/")
html = response.read
emoji = html.scan(/:\S+:/)
@cobyism
cobyism / osx-install-media.md
Last active March 11, 2023 00:42
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).