Skip to content

Instantly share code, notes, and snippets.

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 24, 2024 15:28
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@adilsoncarvalho
adilsoncarvalho / install-ruby
Last active October 12, 2015 01:58
Installing Ruby 1.9.3p286 on Ubuntu (production server)
#!/bin/bash
# must run as root!!!
RUBY_VERSION=1.9
RUBY_PATCH=1.9.3-p429
#RUBY_PATCH=1.9.3-p385
#RUBY_PATCH=1.9.3-p286
#RUBY_PATCH=1.9.3-p194
@afair
afair / curl reference.md
Last active February 11, 2024 05:54
Curl command reference with most used options. No overwhelming man page.

Curl Reference

Use the curl command line tool from your terminal window to access web pages, resources, and API's. This swiss-army knife of the internet also supports many more protocols and tools.

Command format

curl [options] URL

The complete, offical reference page is here.

@ryanflorence
ryanflorence / instructurecon.js
Created June 19, 2013 20:48
instructurecon code
onPage(/\/courses\/\d+\/settings/, function() {
// do something
});
hasAnyRole('admin', function(hasRole) {
if (hasRole) {
// do something
} else {
// do something else
}
@grahamb
grahamb / sfucanvas.md
Last active August 16, 2021 17:54
SFU's Canvas LMS infrastructure and ugprade

🎓 Canvas at SFU

Simon Fraser University is a mid-sized comprehensive university with three campuses in the Greater Vancouver area of British Columbia, Canada. We are a trimester school, with a Fall, Spring and Summer term. We have approximately 25,000 undergraduate FTEs.

SFU chose Canvas as its new LMS during a selection process in 2011/2012. We went into production in 2012. As of this writing, our enrollment counts in Canvas are:

  • Students: 25250
  • Teachers: 1070
  • TAs: 865
@jnimety
jnimety / implicit_tls_ftp.rb
Last active May 18, 2024 01:14
Ruby Net::FTP Implicit TLS
# Assumes a recent version of ruby with TLS and Explicit TLS support
class ImplicitTlsFTP < Net::FTP
FTP_PORT = 990
def connect(host, port = FTP_PORT)
synchronize do
@host = host
@bare_sock = open_socket(host, port)
begin
ssl_sock = start_tls_session(Socket.tcp(host, port))