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
/* | |
Adapted from https://github.com/sindresorhus/github-markdown-css | |
The MIT License (MIT) | |
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |
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
# Use memory store for assets cache in development/test to avoid caching | |
# to tmp/assets, because it causes hiding of deprecation messages in | |
# stylesheets, sometimes break parallel_tests and doesn't always refresh | |
# gem stylesheets in development | |
config.assets.configure do |env| | |
if Rails.env.development? || Rails.env.test? | |
env.cache = ActiveSupport::Cache.lookup_store(:memory_store) | |
end | |
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
javascript:$('.list').each(function(i, col) { | |
var ests = $($(col).find('.list-card-title').text().match(/\[([\dF-]+)+\]/ig)).map(function(_, estStr) { | |
console.log("Found string: ", estStr); | |
var result = estStr.replace(/[\[\]]/g, ''); | |
if (result.length == 4) { | |
result = result.split('').reduce(function(sum, current) { | |
var currentValue = parseInt(current.replace('-', '0').replace(/f/i, '16')); | |
return currentValue + sum; | |
}, 0); |
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
#! /bin/zsh | |
# if git branch name contains number, add leading [#NNN] to the commit message | |
# so github will add reference to specific issue | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NUMBER=$(git symbolic-ref --short HEAD | sed "s/[^0-9]//g") | |
COMMIT_TEXT=$(cat $1) | |
if [ -n "$BRANCH_NUMBER" ] && ! [[ $COMMIT_TEXT =~ "\[.*#$BRANCH_NUMBER\]" ]]; then |
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 'minitest/autorun' | |
class Doctor | |
def initialize(last_name) | |
@last_name = last_name | |
end | |
def display_name | |
"Dr. #{@last_name}" | |
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
class AttachedAsset < ActiveRecord::Base | |
belongs_to :attachable, :polymorphic => true | |
has_attached_file :asset, :styles => { :large => "800x800", :medium => "400x400>", :small => "200x200>" } | |
attr_accessible :asset, :asset_file_name | |
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
# cut page 23 from pdf | |
pdftk smashing_css.pdf cat 23 output sheet.pdf | |
# crop margins | |
pdfcrop --margins '-50 -100 -100 30' sheet.pdf sheet1.pdf | |
# convert to monochrome (text) djvu | |
pdf2djvu -o file.djvu --fg-colors=black --anti-alias --dpi=600 file.pdf |