Skip to content

Instantly share code, notes, and snippets.

View therealadam's full-sized avatar
🍔
Building Pingboard. Accepting JavaScript. Still loving Rails. Telling jokes.

Adam Keys therealadam

🍔
Building Pingboard. Accepting JavaScript. Still loving Rails. Telling jokes.
View GitHub Profile
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@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.

@coreyhaines
coreyhaines / Editable.elm
Last active August 25, 2022 05:11
type Editable
module Editable exposing (..)
type Editable ofType
= NotEditing { value : ofType }
| Editing { originalValue : ofType, buffer : ofType }
value : Editable ofType -> ofType
value editable =
@coreyhaines
coreyhaines / Flow.elm
Last active December 14, 2020 00:20
General workflow-management
module Flow exposing (Flow(..), map, withDefault, mapDefault, view, update)
import Html
type Flow state
= NotRunning
| Running state
@glv
glv / _TheClojureStateMonad.md
Last active January 19, 2024 19:41
Comparing monadic and non-monadic styles for managing state in Clojure

The Clojure State Monad: A Non-Trivial Example

When I started writing this in early 2013, I intended it to be a series of blog posts about effective use of the state monad (and the `algo.monads` library in general) in Clojure. Along the way, I learned that `algo.monads` is both somewhat buggy and extremely slow, and I decided that the most effective way to use monads in Clojure was simply not to use them at all. Therefore, I abandoned work on the post. But it's still probably useful as a good way of explaining the state monad by example, so I've spruced the old draft up slightly and am posting it here.

TL;DR

There are too many monad tutorials, and not enough practical examples of solving real problems with monads. This article shows how to use

@bkeepers
bkeepers / twitnoise
Created June 3, 2014 12:29
Signal & Noise lists on Twitter
#!/bin/bash
#
# This script encapsulates my process for keeping up with Twitter:
#
# 1. Create a private list called Signal, add everyone you currently follow to
# it, and begin curating it.
# 2. Follow everyone you meet or find interesting.
# 3. Create a private list called Noise, containing everyone you follow that are
# not in Signal.
# 4. Use Signal as your timeline in tweetbot. Switch to Noise when you are bored
@skwp
skwp / dynamic_method_spec.rb
Created December 7, 2013 00:44
Fail your build for user-defined style rules.
require 'spec/support/grep_matcher'
describe do
disallow_presence_of pattern: "send(.*#",
location: "app/",
description: "Do not use dynamic method invocations",
failure: "Please change dynamic method call to something more sane."
end
@schickling
schickling / Rakefile
Last active January 31, 2024 23:00
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@glv
glv / trouble-free-bundler.md
Last active March 16, 2018 14:50
This is a thing I wrote over a year ago for the internal LivingSocial wiki. There's nothing LS-specific about it, and it seems generally useful, so …

Trouble-Free Bundler

Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.

An Elasticsearch in Crash Course!

By Andrew Cholakian

All examples use the Stretcher ruby gem

What is Elasticsearch?

  • An Information Retrieval (IR) System
  • A way to search your data in terms of natural language, and so much more