⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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
#!/dev/null | |
# This 'script' is a set of instructions for preparing and bundling an Arch | |
# Linux AMI for Amazon's EC2. Bits are to be run on three different | |
# computers, and there is interaction required, so please follow along and | |
# run commands individually. | |
# PROTIP: THESE DON'T ACTUALLY WORK. That's why I'm pasting them here, | |
# attemping to get some input on what I'm doing wrong. When the instructions | |
# are ready for prime-time, I'll clean them up and post them to my blog. If | |
# you're really interested, watch for it there: |
YARD CHEATSHEET http://yardoc.org
May 2020 - updated fork: https://gist.github.com/phansch/db18a595d2f5f1ef16646af72fe1fb0e
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains 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
This playbook has been removed as it is now very outdated. |
This file contains 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
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
This file contains 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
FIXME: | |
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8 | |
or | |
ERROR -: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0 | |
gem uninstall nokogiri libxml-ruby | |
brew update | |
brew uninstall libxml2 |
This file contains 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
# Link: <http://example.com/resources?page=2>; rel="next", <http://example.com/resources?page=5>; rel="last" | |
links = {} | |
headers['Link'].split(',').each do |link| | |
link.strip! | |
parts = link.match(/<(.+)>; *rel="(.+)"/) | |
links[parts[2]] = parts[1] | |
end |
This file contains 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
#!/usr/bin/env ruby | |
require 'english' | |
require 'rubocop' | |
ADDED_OR_MODIFIED = /A|AM|^M/.freeze | |
changed_files = `git status --porcelain`.split(/\n/). | |
select { |file_name_with_status| | |
file_name_with_status =~ ADDED_OR_MODIFIED |
Sending emails from a Gmail account using Go can be done using Go's smtp package. Simply:
- Connect to
smtp.gmail.com
on port 587, authenticating using your email and password - Optionally, use Go's
text/template
package to format theTo
,From
,Subject
, andBody
fields of your email - Use
smtp
'sSendMail
method to actually send the email
An example usage follows. The SmtpTemplateData
struct is used to hold the context for the templating mentioned in (2) above.
OlderNewer