Add a simple intro tutorial to your app
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
# inspired by https://gist.github.com/406460 and | |
# http://pivotallabs.com/users/rolson/blog/articles/1249-stubbing-out-paperclip-imagemagick-in-tests | |
# plus some additional monkeypatching to prevent "too many files open" err's | |
# | |
# place this file in <app root>/spec/support | |
# | |
RSpec.configure do |config| | |
$paperclip_stub_size = "800x800" | |
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
" first install and authorize the twitter command line gem "t" `gem install t` | |
" authorize the t client, and put the following in your vimrc and you're good to go | |
function Twitter() | |
let result = system('t timeline -n 4') | |
echo "\n" | |
echo "\n" | |
echo "Four most recent tweets in your timeline:\n" | |
echo "\n" | |
echo result |
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
" ctrl+l, h, j, k will resize panes in the directions you would expect | |
map <C-l> 5<C-w>> | |
map <C-h> 5<C-w>< | |
map <C-j> 3<C-w>+ | |
map <C-k> 3<C-w>- | |
" zoomwin plugin required, leader leader will toggle fullscreen for active pane | |
map <leader><leader> :ZoomWin<cr> |
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
module TruncationHelper | |
# Not all character sizes are equal, 120 characters of English text | |
# could take up a lot more screen space than 120 characters of | |
# Chinese text. | |
def locale_aware_truncate(text, options) | |
length = case I18n.locale | |
when :ja, :zh | |
options[:length][I18n.locale] || options[:length][:en] / 2 | |
else | |
options[:length][:en] |
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 SomeClass | |
def some_method | |
some_var = "from some class" | |
yield | |
end | |
end | |
SomeClass.new.some_method do # |?| | |
puts ___.some_var | |
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
# Undo a migration regardless of whether or not its id exists in the migrations table | |
# | |
# filename eg: '20131118193730_create_people_table` | |
# | |
def unmigrate(filename) | |
require Rails.root.to_s + '/db/migrate/' + filename | |
migration_class = filename.gsub(/\d+_/, '').camelize.constantize | |
migration_class.down | |
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
-rw-r--r-- 1 brentvatne staff 617015 8 Feb 14:36 testable-with-camel-snake-kebab-and-transform-keys.js | |
-rw-r--r-- 1 brentvatne staff 602954 8 Feb 14:53 testable-with-camel-snake-kebab-without-transform-keys.js | |
-rw-r--r-- 1 brentvatne staff 602458 8 Feb 14:29 testable.without-camel-snake-kebab.js |
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
var d3 = require('d3'); | |
var jsdom = require("jsdom-little"); | |
var React = require('react-native'); | |
var { View, Text } = React; | |
var Svg = require('./Svg'); | |
var parseDate = d3.time.format("%d-%b-%y").parse; | |
var D3Chart = React.createClass({ | |
componentDidMount() { |