Skip to content

Instantly share code, notes, and snippets.

View slothbear's full-sized avatar
🏠
Working on Zocalo, club membership/newsletter tracking.

Paul Morganthall slothbear

🏠
Working on Zocalo, club membership/newsletter tracking.
View GitHub Profile
@slothbear
slothbear / v1.1.24.md
Created February 26, 2022 16:06
Zócalo 1.1.24: no more duplicate search box!!!

new & notable in version 1.1.24 on 25-Feb-2022

  • Using the back button from a detail record to a list page no longer duplicates the Search box and pagination message ("showing 1 to 39 of 39 entries").

plans for next version

  • random tarot card: VIII Strength
@slothbear
slothbear / send_launch.applescript
Created July 12, 2017 16:30
"Send a message when I open an app", inverted
-- Send me a message and launch Safari.
tell application "Messages"
-- Use the following statement to find the service to send to.
-- get name of every service
set destination to buddy "pcm@morganthall.com" of service "E:pcm@morganthall.com"
set message to "Hey, I'm launching the application: Safari"
send message to destination
@slothbear
slothbear / vienna.rb
Last active April 30, 2016 21:01
render HAML template to string
require 'haml'
template = <<EOF
- if true
%h1 {{SECTION_NO_1}}
- if false
%h1 {{SECTION_NO_2}}
- if true

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@slothbear
slothbear / dabblet.html
Created August 15, 2014 20:24
Untitled
<link rel="stylesheet"type="text/css" href="http://morganthall.com/julia.css">
<h1>
Saluton &hearts;
</h1>
<h1 style="background-color:papayawhip">
Ghis revido
</h1>
<img src="http://placekitten.com/400/400">
@slothbear
slothbear / dabblet.html
Created August 15, 2014 19:05
Untitled
<link rel="stylesheet"type="text/css" href="http://morganthall.com/julia.css">
<h1>
Saluton &hearts;
</h1>
<h1 style="background-color:papayawhip">
Ghis revido
</h1>
<img src="http://placekitten.com/400/400">
➜ dev brew
I'm in ur rubygems!
ur load_path: ["/Library/Ruby/Site/2.0.0", "/Library/Ruby/Site/2.0.0/x86_64-darwin13", "/Library/Ruby/Site/2.0.0/universal-darwin13", "/Library/Ruby/Site", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin13", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin13", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin13", "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13"]
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:15:in `require': cannot load such file -- rubygems/compatibility (LoadError)
from /System/Library
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window =
UIWindow.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame)
@window.makeKeyAndVisible
@button = UIButton.buttonWithType(UIButtonTypeRoundedRect)
@button.setTitle("start speech timer", forState:UIControlStateNormal)
@button.sizeToFit
@slothbear
slothbear / dabblet.css
Created February 15, 2014 21:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
#greeting {color: blue};
@slothbear
slothbear / gist:8961477
Last active December 11, 2020 02:49
new_instance returns Java::JavaObject instead of a java.awt.Color
constructor = java.awt.Color.java_class.constructor(Java::int, Java::int, Java::int)
some_color = constructor.new_instance(134, 178, 25).getRGB
# => Error:
# NoMethodError: undefined method `getRGB' for #<Java::JavaObject:0x6386ec27>
# solution: call to_java(java.awt.Color)
other_color = constructor.new_instance(134, 178, 25).to_java(java.awt.Color).getRGB