This file contains 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 'rubygems' | |
require 'typhoeus' | |
require 'orthrus' | |
require 'json' | |
class Gist | |
include Orthrus | |
remote_defaults :base_uri => "http://gist.github.com" | |
define_remote_method :index, :path => "/api/v1/:format/gists/:login", |
This file contains 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 BootstrapPaginationRenderer < WillPaginate::ViewHelpers::LinkRenderer | |
include ActionView::Helpers::UrlHelper | |
def to_html | |
@current_page = @collection.current_page.to_i | |
links = @options[:page_links] ? windowed_links : [] | |
links.unshift(page_link_or_span(previous_page, 'prev', @options[:previous_label].html_safe)) | |
links.push(page_link_or_span(next_page, 'next', @options[:next_label].html_safe)) |
This file contains 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 OembedTranslator | |
include ActionView::Helpers::TagHelper | |
# usual stuff over here.. | |
def embed | |
@content.gsub(/(?:<a.+?<\/a>)|((?:www|https?).*?)(?=\s|\Z)/) do |match| | |
match.present? or next # regexp not perfect yet, there are nil matches for some reason | |
oembed_code_for(match) | |
end |
This file contains 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
source /usr/local/opt/chruby/share/chruby/chruby.sh | |
source /usr/local/opt/chruby/share/chruby/auto.sh | |
source ~/.git-completion.bash | |
# source ~/.rake_cap_bash_autocomplete.sh | |
export EDITOR='subl -w' | |
export SKIP_CLEANUP_DIRECTORIES='1' | |
export ANSIBLE_REMOTE_USER='johannes.opper' |
This file contains 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 ConfluencePre < ReverseMarkdown::Converters::Pre | |
def extract_language(node) | |
brush = node['class'].to_s[/brush:\s?(:?.*);/, 1] | |
brush || super | |
end | |
end | |
ReverseMarkdown::Converters.register :pre, ConfluencePre.new |
This file contains 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 'ffi' | |
module Hello | |
extend FFI::Library | |
ffi_lib 'target/release/libembed.dylib' | |
attach_function :process, [ :string ], :string | |
end | |
puts Hello.process('foo') |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
remote_user = ENV['ANSIBLE_REMOTE_USER'] | |
raise "You need to set ANSIBLE_REMOTE_USER in your shell" unless remote_user |
This file contains 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 EncodingRepairer | |
REPLACEMENTS = { | |
"€" => "€", "‚" => "‚", "„" => "„", "…" => "…", "ˆ" => "ˆ", | |
"‹" => "‹", "‘" => "‘", "’" => "’", "“" => "“", "â€" => "”", | |
"•" => "•", "–" => "–", "—" => "—", "Ëœ" => "˜", "â„¢" => "™", | |
"›" => "›", "Å“" => "œ", "Å’" => "Œ", "ž" => "ž", "Ÿ" => "Ÿ", | |
"Å¡" => "š", "Ž" => "Ž", "¡" => "¡", "¢" => "¢", "£" => "£", | |
"¤" => "¤", "Â¥" => "¥", "¦" => "¦", "§" => "§", "¨" => "¨", | |
"©" => "©", "ª" => "ª", "«" => "«", "¬" => "¬", "®" => "®", |
This file contains 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
{ | |
"auto_complete": true, | |
"color_inactive_tabs": true, | |
"color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme", | |
"copy_with_empty_selection": true, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".tags*", | |
"tags", |
This file contains 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
[ | |
{ "keys": ["ctrl+alt+a"], "command": "alignment" }, | |
{ "keys": ["super+,"], "command": "reveal_in_side_bar"}, | |
{ "keys": ["super+alt+r"], "command": "goto_definition" }, | |
// Clipboard manager | |
{ "keys": ["super+x"], "command": "clipboard_manager_cut" }, | |
{ "keys": ["super+c"], "command": "clipboard_manager_copy" }, | |
{ "keys": ["super+v"], "command": "clipboard_manager_paste", "args": { "indent": true } }, | |
{ "keys": ["super+ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": false } }, | |
{ "keys": ["super+shift+v"], "command": "clipboard_manager_previous_and_paste" }, |
OlderNewer