Skip to content

Instantly share code, notes, and snippets.

View dannysmith's full-sized avatar

Danny Smith dannysmith

View GitHub Profile
@dannysmith
dannysmith / gist:f440a8aca588b828c169
Last active November 19, 2015 12:29
New Progect commands
mkdir my_project
cd my_project
touch README.md Gemfile
echo "# This is My Project" > README.md
echo "source 'https://rubygems.org\nruby'2.1.1'\n\ngem 'rspec'" > Gemfile
mkdir spec
touch spec/spec_helper.rb
echo "require 'rspec'" > spec/spec_helper.rb
@dannysmith
dannysmith / common_issues.md
Last active November 27, 2015 14:51
Ruby Issues - SDET Course 3

Common Issues

Newlines at end of files

All files should end with a newline character. You can see when files don't have a newline at the end on GitHub.

Image

If you're using Sublime Text, you can add this to your preferences file:

scss:
enabled: false
ruby:
config_file: .rubocop.yml
javascript:
enabled: false
-- See here: http://www.macstories.net/tutorials/send-selected-mail-message-to-evernote-with-source-url/
-- Slightly modified version of Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Mail"
--get selected messages
set theSelection to selection
set theMessage to item 1 of theSelection
set evernoteEmail to "[email protected]"
set theMessageURL to "message://%3c" & theMessage's message id & "%3e"
@dannysmith
dannysmith / gist:d5507c4b4515d34eff0c
Last active March 1, 2016 02:00
Stip tables and background colours from Sublime Text HTMLExport
// Source: https://github.com/facelessuser/ExportHtml/issues/26
// 1. Export to HTML using "Export to HTML: Show Export Menu" and "Railscast Theme"
// 2. Run this in the Console
// 3. Copy from the browser and paste into powerpoint using Paste Special > Formatted Text.
// Tow work with Keynote, also need to turn off (uncheck) the CSS background colour on the body element.
var codeCells = document.querySelectorAll('table.code_page td.code_line');
console.log('Code Zeilen:', codeCells.length);
var table = document.createElement('table');

Intro

When building Keynote or PowerPoint presentations, I've often wanted an easy way to copy and paste from Sublime Text 3 into the slides, maintaining just the font and sytax highlighting. Thanks to the ExportHTML ST3 plugin and a bookmarklet, I now have it.

If you just want the bookmarklet, here it is...

@dannysmith
dannysmith / oh-my-zsh-plugins-installed.md
Last active April 17, 2016 17:56
Details of oh-my-zsh plugins installed by Danny.
fancy_echo() {
local fmt="$1"; shift
printf "\n$fmt\n" "$@"
}
fancy_echo "Welcome to the Sparta macOS Installer"
echo "-------------------------------------"
echo
# Get admin password & store in $passwd
echo -n "Admin Password: "
stty -echo
read passwd
stty echo
echo
# XCode Command Line Tools
fancy_echo "Installing XCode Command Line tools..."
xcode-select --install
sleep 3
osascript <<EOD
tell application "System Events"
tell process "Install Command Line Developer Tools"
keystroke return
click button "Agree" of window "License Agreement"
end tell