Skip to content

Instantly share code, notes, and snippets.

View dannysmith's full-sized avatar

Danny Smith dannysmith

View GitHub Profile
@dannysmith
dannysmith / gist:9780920
Last active March 1, 2024 00:35
Installing Canvas LMS
# Download the source
git clone https://github.com/instructure/canvas-lms.git canvas
cd canvas
git checkout --track -b stable origin/stable
rbenv install –keep 1.9.3-p545
rbenv local 1.9.3-p545
brew install xmlsec1 postgresql
bundle install
# If you get this error: No source for ruby-1.9.3-p545 provided with debugger-ruby_core_source gem.

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 / osx_setup.sh
Last active October 17, 2023 08:20
Sensible defaults for New Mac
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@dannysmith
dannysmith / interviews.md
Created March 10, 2021 00:55
Lesson Plan for Interviews

Lesson: Interview Technique

Timings

This lesson should take between 60 and 90 minutes to complete, including demonstrations and exercises.

Prerequisites

None

require 'httparty'
class Medium
def self.posts(username:, limit:)
get_posts(username, limit).each do |post|
post[:published_at_as_date] = Date.strptime((post[:published_at].to_f / 1000).to_s, '%s')
end
end
class << self
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #808080 } /* Comment */
.highlight .err { color: #F00000; background-color: #F0A0A0 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #303030 } /* Operator */
.highlight .cm { color: #808080 } /* Comment.Multiline */
.highlight .cp { color: #507090 } /* Comment.Preproc */
.highlight .c1 { color: #808080 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
@dannysmith
dannysmith / wakeup.rb
Created July 21, 2017 23:21
Hue API Calls
require 'faraday'
require 'json'
require 'pry'
BRIDGE = "XXXX"
DEVICE_ID="XXXX"
puts 'Waking Danny up!'
def get(path)
url = "#{BRIDGE}/api/#{DEVICE_ID}#{path}"
article > * {
font-family: var(--font-copy);
line-height: 1.5;
max-width: 33rem;
margin-left: auto;
margin-right: auto;
}
// Natural flow margin
article > * + * {
// ==========================================================================
// Base styles: Global Basics and resets
// ==========================================================================
html {
box-sizing: border-box;
font-variant-ligatures: common-ligatures discretionary-ligatures;
text-rendering: optimizeLegibility;
scroll-behavior: smooth;
-webkit-font-smoothing: antialiased;