Skip to content

Instantly share code, notes, and snippets.

Coby Chapple cobyism

Block or report user

Report or block cobyism

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active Nov 13, 2019
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).
View gh-pages-deploy.md

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).

@cobyism
cobyism / emojibomb.rb
Last active Sep 27, 2019
Generate a random emoji bomb via the command-line
View emojibomb.rb
#!/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 May 21, 2019
Command to create installable OS X USB drive.
View osx-install-media.md

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 / rpi-vnc-on-boot.md
Last active Jan 21, 2019
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
View rpi-vnc-on-boot.md

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
View diy-cardboard-laptop-stand.md

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
View keybase.md

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 / gh-gmail-label-script.js
Created May 5, 2014
GitHub Email Notification labeller script for Google Apps/Gmail
View gh-gmail-label-script.js
var my_teams = ["@github/css", "@github/design"] // Add any teams you want autodetected to this list
var base_label = ["GitHub"]
var my_teams_regex = new RegExp('(' + my_teams.join('|') + ')')
function GitHubThread(thread) {
this._thread = thread
// Determine why we got this message and label the thread accordingly.
//
@cobyism
cobyism / digital-ocean-swap.sh
Created Jun 27, 2015
Commands to create swapfile on a Digital Ocean Ubuntu droplet
View digital-ocean-swap.sh
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -s
free -m
@cobyism
cobyism / design-workflow-q-a.md
Last active Feb 23, 2017
Q&A on design workflows.
View design-workflow-q-a.md

Design workflow Q&A

James Kirkpatrick sent me some questions about designing in the browser, and design workflows in general to help with his dissertation at the University of Ulster. Here are my responses.

Question: Do you feel that designing in browser is fast becoming the standard in web design, or do you feel that there will still be a few die-hard designers that will refuse to adopt the idea?

I think it is definitely on its way to becoming the standard, especially with the improvements in the pipeline in terms of what’s possible within developer tools (source-map support for Sass, CoffeeScript and so forth). It’s not catching on as quickly as I feel it should be though (given the benefits I feel it has), and honestly I feel like that’s simply because it’s hard for people to drop the tools they know and love cold-turkey. It can take a while to adjust to new tools and workflows, and to be able to afford the time in-between where you just have to accept that you won’t be as productive as usual is

@cobyism
cobyism / dslchecker.rb
Created Oct 9, 2014
Started hacking on a BT DSL checker screen scraper thing
View dslchecker.rb
require 'rubygems'
require 'nokogiri'
require "net/http"
require "uri"
class DSLChecker
def check_phone_number(number)
params = { "TelNo" => number }
endpoint = URI.parse("http://www.dslchecker.bt.com/adsl/ADSLChecker.TelephoneNumberOutput")
response = Net::HTTP.post_form(endpoint, params)
You can’t perform that action at this time.