Skip to content

Instantly share code, notes, and snippets.

@mando
mando / OTDC.md
Last active December 12, 2023 14:40
Old Timer Drinking Club

Y'all, I'm feeling awful wistful and nostalgic these days.

For a bit, I thought I missed the old days of Austin on Rails but, just between you and me, I just miss y'all. I miss spending an evening at the pub with you folks, dishing that hot goss and planning schemes and dreaming big dreams.

It's no secret what happened - life and kids and work and shifts in priority. I get it. We all get it.

You can't step into the same river twice, said Heraclitus. I say we prove that jerk wrong.

Let's get together and sit and drink and talk and think and scheme and dream - add a comment if you're interested along with dates and times that work for you. This ain't a democracy but we can do our best to accomodate the most we can. This also ain't exclusionary - if you're reading this and don't feel like you were a part of the OG AoR scene but for some reason want to join us, you're heckin invited too. I've got a drink and a smile for all y'all.

@ianstormtaylor
ianstormtaylor / slate-node-portal.js
Created September 13, 2016 18:21
A React component example that makes it simple to position an element relative to a Slate node.
import React from 'react'
import Portal from 'react-portal'
import getOffsets from 'positions'
import { findDOMNode } from 'slate'
/**
* No-op.
*
* @type {Function}
@webmat
webmat / dashboards.rb
Created February 22, 2012 20:46
First draft of an active_admin-based view for Delayed::Job
ActiveAdmin::Dashboards.build do
# Add this section in your dashboard...
section "Background Jobs" do
now = Time.now.getgm
ul do
li do
jobs = Delayed::Job.where('failed_at is not null').count(:id)
link_to "#{jobs} failing jobs", admin_jobs_path(q: {failed_at_is_not_null: true}), style: 'color: red'
end
@sethbro
sethbro / spec_helper.rb
Created February 10, 2012 01:09
Rails unit, functional and integration tests in Minitest spec format.
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
require 'miniskirt'
require 'capybara/rails'
@watson
watson / ability.rb
Created October 5, 2011 09:50
Active Admin CanCan integration with shared front/backend User model and multi-level autherization
# app/models/ability.rb
# All front end users are authorized using this class
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new
can :read, :all
@rixth
rixth / gist:1088478
Created July 18, 2011 03:15
jquery bookmarklet
/**
* This is a template bookmarklet that loads jQuery. Also works
* if another library has defined $ itself.
*/
(function () {
var s = document.createElement('script');
s.setAttribute('src', 'http://jquery.com/src/jquery-latest.js');
s.onload = function () {
jQuery.noConflict();
@twmills
twmills / pre-commit
Created February 23, 2011 03:04
git pre-commit example
#!/bin/bash
source ".rvmrc"
ruby .git/hooks/run_tests.rb
run_tests.rb
-----------
puts "Running tests..."
`bundle exec rspec spec/* > /dev/null 2>&1 && cucumber -r features > /dev/null 2>&1`
if $? != 0
@jamiew
jamiew / unicorn.rb
Created October 14, 2010 17:58 — forked from jimmysoho/gist:534668
Unicorn config for use with bundler and capistrano - fixes issues with environment pollution.rb
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30
@rrrodrigo
rrrodrigo / rails-app
Created September 23, 2010 13:51
Rails production.log rolling using the standard Linux logrotate mechanism
# put this into /etc/logrotate.d/app-production
# to have a Rails app running on unicorns rotating/rolling its logs monthly
# check with logrotate -f /etc/logrotate.d/app-production
/web/app/production/shared/log/*.log {
monthly
missingok
rotate 24
compress
delaycompress
@alexg0
alexg0 / Rakefile
Created April 16, 2010 18:02
for chef-repo - load and dump data bags
# ...
# append following lines
Dir[ File.join(File.dirname(__FILE__), 'tasks', '*.rake') ].sort.each do |f|
load f
end