This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var prop = 'VisibilityState'; | |
var evt = 'visibilitychange'; | |
var vendors = ['webkit', 'ms']; | |
var vendor; | |
function set_state(state){ | |
$(window).trigger('visibilitychange', state); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am mikeycgto on github. | |
* I am mikeycgto (https://keybase.io/mikeycgto) on keybase. | |
* I have the public key with fingerprint 3339 7AF8 1078 43C9 B661 B3AE 9EB4 65BB A866 703F | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://lyrics.wikia.com/The_National')) | |
doc.css('h2').each do |header| | |
img = header.next_element | |
list = img.next_element if img | |
if list && list.name == 'ol' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample A | |
var x = y; | |
function y(){}; | |
// Sample B | |
var a = b; | |
var b = function(){}; | |
// Sample C | |
i = j; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
st# status bar | |
set-option -g status-utf8 on | |
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default | |
# default window title colors | |
set-window-option -g window-status-fg colour244 #base0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.barkingiguana.com/2010/04/11/a-one-line-web-server-in-ruby/ | |
ruby -rwebrick -e'WEBrick::HTTPServer.new(port: ARGV.pop.to_i, BindAddress: ARGV.pop.to_s, DocumentRoot: Dir.pwd).start' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReportsController < ApplicationController | |
authorize_resource :admin, :support | |
find_resource :report, from: :current_admin, except: [:index, :new, :create] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admin < ActiveRecord::Base | |
include SimonSays::Roleable | |
has_roles :design, :support, :moderator, as: :access | |
end | |
# > Admin.new.access | |
# => [] | |
# > Admin.new(access: :support).access |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
include SimonSays::Authorizer | |
self.default_authorization_scope = :current_user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'devise-async-stretch' |