Skip to content

Instantly share code, notes, and snippets.

View chendo's full-sized avatar

chendo chendo

View GitHub Profile
@chendo
chendo / output
Last active May 13, 2016 20:40 — forked from lmarburger/output
Bundler CDN benchmarking with Fastly and Cloudflare (without HTTPS). The version on Cloudflare won't match the rubygems.org exactly as I can only take a snapshot, but the file size will be similar.
$ curl -s https://gist.github.com/chendo/6545822/raw/time.sh | bash
== Fastly ==
DNS: 0.003 CONNECT: 0.217 REQSENT: 0.650 STARTTX: 1.378 TOTAL: 3.739
X-Served-By: cache-v44-ASH
X-Cache: MISS
DNS: 0.001 CONNECT: 0.248 REQSENT: 0.746 STARTTX: 1.018 TOTAL: 3.734
X-Served-By: cache-v44-ASH
X-Cache: HIT
class SiriProxy::Plugin::Twitter < SiriProxy::Plugin
# this watches when in the default context
listen_for /tweet (.*)/ do |data, tweetText|
show_rich_snippet do
image 'http://cl.ly/1l040J1A392n0M1n1g35/content' # this just makes things looks nice, but is obviously specific to my username
text tweetText
end
# this locks out other plugins until a confirmation or deny
confirm do
confirmed do
class SiriProxy::Plugin::Twitter < SiriProxy::Plugin
# this watches when in the default context
listen_for /tweet (.*)/ do |data, tweetText|
show_rich_snippet do
image 'http://cl.ly/1l040J1A392n0M1n1g35/content' # this just makes things looks nice, but is obviously specific to my username
text tweetText
end
# this locks out other plugins until a confirmation or deny
confirm do
window.Widget.Trending: class TrendingWidget extends Widget
constructor: (config) ->
Widget.Trending.instance: this
@template: """
<div class='widget small trending'>
<ul>
{{#topics}}
<li class='down'>{{name}}</li>
{{/topics}}
# Symbol to Proc is a mutha' fucking dirty hack. It brings the indirection
# that we hated from Pearl to Ruby. How it made it into core I don't know.
# Anyway, rather than bitch and moan too much, here is an alternative method
# which is much more expressive and has the same number of characters. The
# name pick comes from Rebol, though it functions more like select there.
# Benchmark:
# user system total real
# 0.200000 0.000000 0.200000 ( 0.212325)
# 0.470000 0.000000 0.470000 ( 0.475471)
/* Instructions:
*
* Download to ~/.mailplane.css
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetLocationPreferenceKey -string ~/.mailplane.css`
* `defaults write com.mailplaneapp.Mailplane WebKitUserStyleSheetEnabledPreferenceKey -bool true`
*
*/
body {
font-family: Helvetica; !important
@chendo
chendo / survey
Created November 2, 2009 01:02 — forked from radar/survey.md
What did you do to get good at Rails?
I just kept at it and worked with it on a professional basis. Constantly learning about new things and working with people who do Rails is also a good start.
Who taught you what you know?
The internet, friends/coworkers and Dr Nic. That, and trial and error. I guess one of the benefits of Rails is many things are implicit and make sense, but sometimes it has quirks and the internet documents a lot of these quirks.
Do you have any fond (or not so fond) memories of your learning experiences?