Skip to content

Instantly share code, notes, and snippets.

View dwarfmondo's full-sized avatar

Matt Vasquez dwarfmondo

View GitHub Profile
@dwarfmondo
dwarfmondo / connection_fix.rb
Created June 28, 2016 23:02 — forked from charlescui/connection_fix.rb
MySQL server has gone away fix - Ensure it only affects mysql2 adapter
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
<div class="row">
<header class="small-12 columns table" role="heading">
<div class="table">
<div class="col shrink">
<h2>@Model.Description</h2>
</div>
<div class="col collapse-left-10">
@if (Model.Active)
{
<span class="label success round uppercase">
window.FooView = Backbone.View.extend({
el: 'body',
events: {
'a.bar click': 'save'
},
save: function(event) {
event.preventDefault();
var src = $(event.currentTarget);
@dwarfmondo
dwarfmondo / hack.sh
Created March 31, 2012 14:09 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dwarfmondo
dwarfmondo / form_reset.sass
Created January 12, 2012 15:57 — forked from nathansmith/1_form-reset.scss
Remove all visual style from form fields
// Note: This file is dependent on Sass and Compass.
// Sass = http://sass-lang.com
// Compass = http://compass-style.org
@import compass/css3
// `Form Element Reset.
//----------------------------------------------------------------------------------------------------
::-moz-focus-inner
@dwarfmondo
dwarfmondo / placeholder-text.js
Created May 1, 2011 19:12
Add placeholder text functionality for IE.
/*
CSS to style the placeholder text.
Separate rule for Firefox.
Cannot stack with WebKit's.
*/
input.placeholder_text,
textarea.placeholder_text {
color: #777;
}
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
module Scopes
def self.included(klass)
klass.class_eval do
attr_writer :church_id
end
end
end
class User < ActiveRecord::Base
include Scopes
@dwarfmondo
dwarfmondo / highcharts_init_charts.js
Created December 14, 2010 22:17
example of globally setting options for all charts
init_charts: function() {
Highcharts.setOptions({
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
tooltip: {
shadow: false,
backgroundColor: 'rgba(0, 0, 0, .85)',
borderRadius: 3,
borderWidth: 0,
style: {
padding: 5,
git tag $(date +%Y-%m-%d_release)
git push origin $(date +%Y-%m-%d_release)