Skip to content

Instantly share code, notes, and snippets.

Avatar

Colin grosscol

View GitHub Profile
@grosscol
grosscol / get-cognito-cfd-target.yaml
Last active Jul 20, 2020
Custom Cloudformation Resource to get CloudFront Distribution of Cognito User Pool
View get-cognito-cfd-target.yaml
---
#
# This template example assumes a UserPool and UserPoolDomain exist.
# The function of this is to produce a custom resource with an attribute
# that can be referenced for DNSName of an Route53::RecordSet AliasTarget.
#
# AliasTarget:
# HostedZone: Z2FDTNDATAQYW2
# DNSNAME: !GetAtt UPDomain.CloudFrontDistribution
@ClaytonJY
ClaytonJY / interval-checking.R
Created Feb 5, 2018
Checking interval membership in a tidy-ish way
View interval-checking.R
library(dplyr)
library(purrr)
#### setup ####
tbl <- tibble(
id = 1:25
)
@tripu
tripu / backup-github.sh
Last active Aug 20, 2019 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
View backup-github.sh
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@jcoyne
jcoyne / Vagrant
Created Dec 7, 2015
Vagrantfile for hydra-camp box
View Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
@no-reply
no-reply / CHODatastream.rb
Last active Aug 29, 2015
Hydra Connect RDF Workshop Walkthrough
View CHODatastream.rb
# lib/models/datastream.rb
class CHODatastream < ActiveFedora::NtriplesRDFDatastream
property :title, predicate: RDF::DC.title
property :creator, predicate: RDF::DC.creator
property :date, predicate: RDF::DC.date
property :location, predicate: RDF::DC.spatial
end
View git-step.sh
#!/bin/bash
show_usage () {
echo "Usage: `basename $0` [START [END]]"
echo
echo "Steps through the commit history from START to END,"
echo "then returns to the branch or commit from before execution."
echo
echo "START defaults to the root commit (beginning of history)."
echo "END defaults to current branch/commit."
@ebeigarts
ebeigarts / RAILS_RELATIVE_URL_ROOT.md
Last active Aug 28, 2020
RAILS_RELATIVE_URL_ROOT
View RAILS_RELATIVE_URL_ROOT.md

RAILS_RELATIVE_URL_ROOT

Rails

By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.

To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
@clintel
clintel / gist:1155906
Created Aug 19, 2011
Fenced code in bullet lists with GitHub-flavoured MarkDown??
View gist:1155906

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@stepheneb
stepheneb / list-native-gems.rb
Created Dec 13, 2010
list RubyGems that have native extensions
View list-native-gems.rb
#!/usr/bin/env ruby
require 'rubygems'
gempaths = Gem::default_path
puts
puts "Scanning paths in Gem::default_path for RubyGems with native extensions ..."
puts
You can’t perform that action at this time.