Skip to content

Instantly share code, notes, and snippets.

@kamui
kamui / helpers.rb
Created October 2, 2012 21:06
sentry-raven in sinatra
module Helpers
def capture_exception(e, env)
if ENV['SENTRY_DSN']
evt = Raven::Event.capture_rack_exception(e, env)
Raven.send(evt) if evt
end
end
end
@kamui
kamui / web_scrape.rb
Last active January 2, 2016 18:59
A ruby script to scrape a site for a specific dom node change. It will email you if you choose when the content changes and what the new node content changed into. Require `nokogiri` and `pony` gems. http://jackchu.com/articles/2014/01/10/web-scraping-content-changes-with-nokogiri/
require 'nokogiri'
require 'open-uri'
require 'pony'
require 'digest'
URL = 'https://encrypted.google.com/'.freeze
CSS_SELECTOR = '#lga'.freeze
INTERVAL = 600.freeze
USER_AGENT = "Ruby/#{RUBY_VERSION}".freeze
SEND_EMAIL = false
@kamui
kamui / category.md
Last active May 17, 2017 21:56
Category Page

Category Page

Hierarchical header structure

Why?

  • ADA
  • SEO

Screen readers and search engines rely on header hierarchy to organize content.

@kamui
kamui / keybase.md
Created November 16, 2017 12:19
Keybase

Keybase proof

I hereby claim:

  • I am kamui on github.
  • I am kamui (https://keybase.io/kamui) on keybase.
  • I have a public key ASBjD4-XEgC4bUvHqCVZEvxcr77h1oyikbdQ7UeeaPIgWAo

To claim this, I am signing this object:

@kamui
kamui / cloudSettings
Last active October 6, 2020 18:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-06T18:06:58.676Z","extensionVersion":"v3.4.3"}
; Cycle between windows of the same app like in macOS - Alt+backtick.
; Original Source: https://gist.github.com/kamui/12c581c09288ac486faeb1095622c873
; Based on: https://gist.github.com/rbika/014fb3570beaef195db0bd53fa681037
; Limitations
; • It does not work in Explorer app
SendMode("Input")
SetWorkingDir(A_ScriptDir)