Skip to content

Instantly share code, notes, and snippets.

View RobinDaugherty's full-sized avatar

Robin Daugherty RobinDaugherty

View GitHub Profile
@RobinDaugherty
RobinDaugherty / CHANGELOG.md
Last active April 12, 2023 05:22 — forked from nmurthy/getTotps.js
Authy OTP Export

If you fork and modify this gist, please add a note (to the bottom) about what you changed.

  • Detect the "period" instead of assuming 10 seconds (which was incorrect) or deriving the period based on the number of digits. (@RobinDaugherty 2020-01-16)
  • Show a warning about Authy proprietary OTPs, which are unsupported in other apps at this time. If any other app supports these, please comment about it. (@RobinDaugherty 2020-01-16)
  • Added QR Code to the console directly so that the OTP secret isn't sent to Google. This came from @Puddly (@RobinDaugherty 2020-01-17)
  • Fixed proprietary Authy codes (used by Twilio and Cloudflare for example) using the fix from @Puddly
@RobinDaugherty
RobinDaugherty / CoreDataController.swift
Last active July 15, 2018 23:50 — forked from kharrison/CoreDataController.swift
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10 and PromiseKit
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
@RobinDaugherty
RobinDaugherty / home-bin-prettify
Last active May 1, 2018 17:58 — forked from macielsmith/home-bin-prettify
prettify json files in git project before comparing
#!/bin/zsh
# Staged files
{ git diff --name-only --diff-filter=d --relative &
# Staged files
git diff --cached --name-only --relative &
# Unstaged new files
git ls-files --others --exclude-standard } |
# Remove duplicates
sort -u |
@RobinDaugherty
RobinDaugherty / pre-commit
Last active April 14, 2016 16:15 — forked from mileszs/pre-commit
Git pre-commit hook for prompting to remove binding.pry and debugger lines lines. (Includes a commented example of adding a check for focus in spec files.)
#!/usr/bin/env ruby
hits = []
checks = {
'_spec\.rb$' => ['focus:[:space:]*true', ',[:space:]*:focus'],
'\.(rb|haml|slim|erb)$' => ['binding\.pry', 'debugger', 'byebug'],
'\.(js|coffee)$' => ['debugger'],
}
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified
@echo off
cls
:start
echo.
echo 1 Fine Arts
echo 2 Classics
echo 3 Computer Science
echo 4 English
echo 5 Mathematics
echo 6 Modern World Languages and Culture
def normalized_content_from_content
if client
options = {
blacklisted_elements: client.article_blacklisted_elements,
whitelisted_tags: client.article_whitelisted_tags,
}
else
options = nil
end
ContentNormalization.new(content, options).normalized_content if content
require 'rubygems'
require 'nokogiri'
require 'gollum'
wiki = Gollum::Wiki.new('auxwiki')
name = 'Ilja Krijger'
email = 'ilja@quittheprogram.org'
f = File.open("AuxiliumWiki-20110705103347.xml")
# Update, upgrade and install development tools:
apt-get update
apt-get -y install build-essential git-core aptitude
aptitude -y remove rbenv
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Set permissions
chgrp users -R /usr/local/rbenv
@RobinDaugherty
RobinDaugherty / tm2-bundles.sh
Last active December 27, 2015 14:49 — forked from tonycoco/tm2-bundles
Textmate 2 bundles for Ruby on Rails development.
mkdir -p ~/'Library/Application Support/Avian/Bundles'
cd ~/'Library/Application Support/Avian/Bundles' && git clone https://github.com/cucumber/cucumber-tmbundle Cucumber.tmbundle
class Picture < ActiveRecord::Base
attr_accessible :picture, :picture_105px_width, :picture_120px_width
has_many :pin
end