Skip to content

Instantly share code, notes, and snippets.

@mcmire
mcmire / current_controller_and_action.rb
Created December 31, 2010 08:54
Hacking Padrino to store current "controller" and "action"
# Put this in lib/current_controller_and_action.rb
module Padrino
module Rendering
module InstanceMethods
private
# Override render to store the current template being rendered so we can refer to it in the view
# This works with Padrino >= 0.9.10
def render(engine, data=nil, options={}, locals={}, &block)
# If engine is a hash then render data converted to json
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@ryangray
ryangray / buttondown.css
Created February 22, 2012 06:45
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
@gstark
gstark / gist:2554213
Created April 30, 2012 00:03
rails tests postgres

I'm trying to run the rails test suite but I keep getting this error:

$ bundle exec rake postgresql:build_databases
createdb: database creation failed: ERROR:  encoding UTF8 does not match locale en_US
DETAIL:  The chosen LC_CTYPE setting requires encoding LATIN1.
createdb: database creation failed: ERROR:  encoding UTF8 does not match locale en_US
DETAIL:  The chosen LC_CTYPE setting requires encoding LATIN1.
@swanson
swanson / 0.wtf-is-this-thing.md
Created September 20, 2012 00:36
vine - an experiment in producing

Every couple months I get this nagging feeling that I am not producing anything. I think this largely correlates with my output at the day-job -- but it starts to bleed into my personal time stuff. And that sucks.

So time to try a new experiment.


Pomodoros for personal time stuff. 25 minutes of work, 5 minutes of reflection. Two a day Monday through Friday, with the weekend to catch up - 10 a week or I fail.

Each pomodoro is also tagged to an associated project/objective. I have to do at least one pomodoro for each objective every week or I fail.

{
"app/models/*.rb": {
"command": "model",
"affinity": "model",
"alternate": ["unit/models/%s_spec.rb", "spec/models/%s_spec.rb"],
"related": "db/schema.rb#%p",
"template": "class %S\nend"
},
"spec/factories/*_factory.rb": {
@jgautsch
jgautsch / mirth_setup.md
Last active July 28, 2023 12:39
Setting up Mirth Connect for production

Mirth Server Setup

First create ec2 Ubuntu instance

Then install all the things needed for Mirth Connect (following this video: http://www.youtube.com/watch?v=omZyAO2naqs)

# Update Ubuntu
sudo aptitude update

# Safe upgrade of Ubuntu
sudo aptitude safe-upgrade
@okunishinishi
okunishinishi / Remove all git tags
Created March 8, 2014 03:12
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@felixkosmalla
felixkosmalla / gist:1c143c6bc6bc22c817ea
Last active January 20, 2021 20:49
Bootstrap Screen Size Indicator. Use this to debug your responsive design.
<div class="size-indicator" style="position:absolute; z-index:100; top:10px; left:10px;">
<span class="label label-default visible-xs-inline">Extra Small (<768px)</span>
<span class="label label-primary visible-sm-inline">Small (≥768px)</span>
<span class="label label-success visible-md-inline">Medium (≥992px)</span>
<span class="label label-info visible-lg-inline">Large (≥1200px)</span>
</div>