Skip to content

Instantly share code, notes, and snippets.

View halloffame's full-sized avatar

Ryan Hall halloffame

View GitHub Profile
@halloffame
halloffame / cleanup-site-branches.rb
Created August 27, 2021 19:40
Ruby script to delete *-site branches older than X days
#!/usr/bin/env ruby
require 'octokit'
REPO = ENV["GITHUB_REPO"]
ACCESS_TOKEN = ENV["GITHUB_ACCESS_TOKEN"]
DELETE_OLDER_THAN_DAYS = ENV["DELETE_OLDER_THAN_DAYS"].to_i
DOIT = ENV["DOIT"] == "true"
client = Octokit::Client.new(access_token: ACCESS_TOKEN)
client.auto_paginate = true

Keybase proof

I hereby claim:

  • I am halloffame on github.
  • I am halloffame (https://keybase.io/halloffame) on keybase.
  • I have a public key ASBDdv1x_eg764aqyNYS1UxcPa-62t8QlvhiYUJcnsgR6Qo

To claim this, I am signing this object:

@halloffame
halloffame / CSCI230_talk.md
Last active December 8, 2016 20:40
Brief overview of some basic web technologies we use.

Git

Git provides basic version control for your code. It also enables you to easily collaborate on shared code with other people.

Basic commands

# Initialize a new local git repository
git init
@halloffame
halloffame / api_auth_version_test.rb
Last active September 15, 2016 19:55
Tests v1.4 migration path for api-auth
require 'rack'
# Since the requests are time-sensitive, you will need to regenerate the
# mock client requests for each of the versions before testing them
# against the different API versions. Otherwise they will all just return false.
API_AUTH_VERSION = '1.3.2'
# gem 'api-auth', '1.3.2'
# gem 'api-auth', '1.4.1'
# gem 'api-auth', '1.5.0'
@halloffame
halloffame / slack_deploy
Created April 28, 2016 17:39
Drop this guy into /usr/local/bin folder for command line deployment through slack through rundeck.
#!/bin/bash
# Drop this guy into /usr/local/bin folder for command line deployment through slack through rundeck.
# exit on failure
set -e
usage() {
cat << EOF
Usage: $0 -t <token> -r <room id> -e <environment> -b <branch>
or: $0 <environment> <branch>
@halloffame
halloffame / dropbox_dump.rb
Created December 2, 2015 19:28
Ruby script to recursively download a given directory from your dropbox.
require 'dropbox_sdk' # gem install dropbox-sdk
require 'fileutils'
require 'thread'
# Example: downloads entire dropbox
# DropboxDump.new('your_access_token', '/download/destination').download("/")
class DropboxDump
attr_accessor :client, :dest, :work_q, :worker_count
def initialize(access_token, dest, max_workers = 3)
@halloffame
halloffame / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@halloffame
halloffame / cleanup_rails_projects.rb
Created February 6, 2015 16:55
Ruby script to clean up all the log and temp files in your rails projects.
# Running this file will clean up all of the temp files in your rails projects
# Instructions:
# 1. Save the file wherever you want
# 2. Replace the RAILS_PATH with the path to your rails projects
# 3. Run `ruby this_file_name.rb`
#
RAILS_PATH = '/replace/with/your/path/to/rails/projects'
require 'rake'
function historySupport() {
return !!(window.history && window.history.pushState !== undefined);
}
function pushPageState(state, title, href) {
if (historySupport()) {
history.pushState(state, title, href);
}
}
@halloffame
halloffame / skeleton.html
Created April 23, 2013 17:24
Skeleton html file to be used as a starting point.
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Example</title>
<!-- <link rel="stylesheet" href="http://example.com/css/style.css" /> -->
</head>
<body>
<h1>Hello World!</h1>