Skip to content

Instantly share code, notes, and snippets.

croaky / dataclips.rb
Last active December 3, 2022 16:36
"Heroku Dataclips" pair programmed with
View dataclips.rb
#!/usr/bin/env ruby
# createdb db
# chmod +x dataclips.rb
# DATABASE_URL=postgres:///db ./dataclips.rb
require "bundler/inline"
require "csv"
gemfile do
croaky /
Last active May 4, 2022 18:57
APIError: GitHub event 'schedule' is not supported.
croaky /
Last active April 17, 2021 17:27
Job queues in Ruby and Postgres

A few lines of Ruby with pg driver is a simple alternative to a job queuing library. Job queues are defined as database tables and workers are defined in one Ruby file.

queuea: bundle exec ruby queue/a.rb
queueb: bundle exec ruby queue/b.rb
croaky /
Created March 10, 2020 17:22
Make a circular favicon from your GitHub avatar
# Make a circular favicon from your GitHub avatar
# ./ username
set -eu
if ! command -v convert >/dev/null; then
echo "error: ImageMagick isn't installed." >&2
croaky / App.tsx
Last active July 25, 2021 19:55
Parcel + TypeScript + React
View App.tsx
import * as React from 'react'
// routing, etc.
import { Reset } from '~/ui/shared/Reset'
export class App extends React.Component {
public render() {
return (

Keybase proof

I hereby claim:

  • I am croaky on github.
  • I am croaky ( on keybase.
  • I have a public key ASAk8K7woEyWuZp5DG0lq8CZyvCSZzpPcO3oCbCz0CJKVAo

To claim this, I am signing this object:

croaky /
Last active June 14, 2016 21:04
Ubuntu setup for a Rails app

Read the script, then run:
croaky / user.rb
Created March 27, 2015 03:09
Clearance with Mongoid
View user.rb
class User
include Clearance::User
include Mongoid::Document
field :confirmation_token, type: String
field :email, type: String
field :password, type: String
field :remember_token, type: String
View sitemap.xml.erb
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="">
<% sitemap_articles.each do |page| %>
<loc><%= page.destination_path.gsub("/index.html", "")%></loc>
croaky / .travis.yml
Created July 31, 2013 18:25
This is our current Travis configuration for our standard Rails 4 + Ruby 2 projects that have Capybara Webkit test suites and Postgres databases. It relies on the bundle_cache.rb and files from to cache gem bundles for much faster test suite setup time.
View .travis.yml
- 2.0.0
- "echo 'gem: --no-document' > ~/.gemrc"
- "echo '--colour' > ~/.rspec"
- gem install fog
- "./script/travis/"
- export DISPLAY=:99.0