Skip to content

Instantly share code, notes, and snippets.

@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active May 7, 2024 22:40
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 27, 2024 04:58 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@dhoelzgen
dhoelzgen / base_controller.rb
Last active October 7, 2021 16:19
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@d3noob
d3noob / leanpubdownloads.html
Last active December 20, 2015 22:09
Leanpub book data investigations
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>dc.js Experiment</title>
<script src='js/d3.v3.js' type='text/javascript'></script>
<script src='js/crossfilter.js' type='text/javascript'></script>
<script src='js/dc2.js' type='text/javascript'></script>
@mxriverlynn
mxriverlynn / 1.html
Created April 11, 2012 14:37
modal dialog with backbone
<script id="modal-view-template" type="text/html">
<div class="modal-header">
<h2>This is a modal!</h2>
</div>
<div class="modal-body">
<p>With some content in it!</p>
</div>
<div class="modal-footer">
<button class="btn">cancel</button>
<button class="btn-default">Ok</button>
@t2
t2 / application.rb
Created December 12, 2011 02:13
Formatting Rails form elements for Twitter Bootstrap error validation
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# add nokogiri gem to Gemfile
elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css "label, input"
elements.each do |e|
if e.node_name.eql? 'label'
html = %(<div class="clearfix error">#{e}</div>).html_safe
elsif e.node_name.eql? 'input'
if instance.error_message.kind_of?(Array)
html = %(<div class="clearfix error">#{html_tag}<span class="help-inline">&nbsp;#{instance.error_message.join(',')}</span></div>).html_safe
@samnang
samnang / rails31init.md
Created September 3, 2011 16:27 — forked from docwhat/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Simple Form, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@shivprasad
shivprasad / google.dictionary.user.js
Created July 18, 2011 09:18
A simple userscript which looks up selected word on google dictionary and alerts its meaning.
// ==UserScript==
// @name Google Dictionary
// @namespace http://byteco.de
// @include *
// ==/UserScript==
var t = '';
function gText(e) {
t = (document.all) ? document.selection.createRange().text : document.getSelection();
t = t.replace(/^\s+|\s+$/g,"");
@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile