Skip to content

Instantly share code, notes, and snippets.

View ConradIrwin's full-sized avatar

Conrad Irwin ConradIrwin

View GitHub Profile
@ConradIrwin
ConradIrwin / search_canvas.cjsx
Created September 27, 2015 05:27
Example canvas icon for canvas-animation-loader
d3 = require 'd3'
module.exports = class SearchIcon
# Construct an instance of a search icon.
# The animation will take {duration} milliseconds, and occupy
# a grid {width}x{height} pixels.
constructor: (duration, width, height) ->
if width != height
throw new ArgumentError("search icon was not rendered in a square")
@ConradIrwin
ConradIrwin / 1. Desk.com gmail style email reply template.html
Last active September 2, 2015 04:50 — forked from DeskWOW/1. Desk.com gmail style email reply template.html
You can copy and paste the following code into the Email Reply Theme to make your emails look like they are sent from gmail.
{% assign emails = case.emails %}
{% assign threadlength = emails.size|minus:1 %}
{% for email in emails reversed %}
{% if forloop.first %}
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
<meta charset="utf-8" />
<style>
@font-face {
font-family: "Fanwood";
src: url("data:;base64,T1RUTwALAIAAAwAwQ0ZGIAtQsmAAACMsAAElp0dQT1MAxYZ3AAFI1AAAZ+JHU1VCW82NpwABsLgAAA7iT1MvMlSa/44AAA+YAAAAYGNtYXB6A+UxAAAfwAAAA0xoZWFkBbJAbgAAAMQAAAA2aGhlYQYYBbUAAA90AAAAJGhtdHhOFkq7AAAA/AAADnhtYXhwA55QAAAAALwAAAAGbmFtZa+D+LgAAA/4AAAPxnBvc3T/uAAyAAAjDAAAACAAAFAAA54AAAABAAAAARmZ0bXw+18PPPUAAwPoAAAAANH/8fwAAAAA0f/x/P6y/nkD6QOEAAAAAwACAAAAAAAAAfQAMgDIAAABBQBNAQUAGwG6ABsB9AA3ApEALwKRACUAgwAbARcAJQEXACUBhwAbAg8AHADLACUBAgAVAN0AOQGWAAUB9AA3AfQAkwH0ADkB9ABNAfQAJQH0AGEB9AAtAfQAUQH0AEQB9AA5AN0AOQDfAC8CDwAmAg8AHAIPACYBbAA5AxsALwK6ABsCUAAlAtsAKgL2ACACXQAlAiYAJQL8ACoDFwAlAU0AGwFN/98CigAlAlAAJQN/ACADLgAlAvAAKgI0ACUDDwAqAoEAJQIQADQCsgASAvMAJQKtAAcD8AAHAn4ABwJVAAcCWQAlASgATQGWAAYBKAAlAZIALwGaABYBkABfAaMAIAHlAAEBnAAgAfMAGwGoABwBMgAgAakADAH3AAcA+QAUASQAAgHBAAYBAQAQAuMAFQICABQBvgAbAgAAFQHqACABSQAVAVEAIAEhAB8B/gALAc0AFgK5ABYB1AAWAdMAFgGdACABMwAlAPcAYQEzACUDGQAqAMgAAAEFAE0BlwAbAf4AJQHuABYCVQAHAPcAYQF9ACUBkABCA0sAMwFgACABmAAvAg8AHAECA
@ConradIrwin
ConradIrwin / smartquotes.fea
Created August 24, 2015 06:52
Smart quotes in an OpenType feature file.
# smart-quotes.
# quotes surrounded by spaces, just leave alone.
ignore sub space quotedbl' space;
# quotes after numers, assume are primes.
ignore sub [ one two three four five six seven eight nine zero ] quotedbl';
# quotes after opening characters are open-quotes.
sub [space
equal
less
parenleft parenleft.u
<body>
<script>
iframe = document.createElement('iframe')
iframe.setAttribute('sandbox', 'allow-same-origin');
blob = new Blob(['<body>'], {type: 'text/html'})
iframe.src = window.URL.createObjectURL(blob)
<body>
<script>
iframe = document.createElement('iframe')
iframe.setAttribute('sandbox', 'allow-same-origin');
blob = new Blob(['<body>'], {type: 'text/html'})
iframe.src = window.URL.createObjectURL(blob)
# Note that x.even are stable releases, x.odd are devel releases
class Node < Formula
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v0.10.36/node-v0.10.36.tar.gz"
sha256 "b9d7d1d0294bce46686b13a05da6fc5b1e7743b597544aa888e8e64a9f178c81"
bottle do
sha1 "ca405f33a5c8e3356a0f477eee43e492e7925927" => :yosemite
sha1 "f17dfa5a02a7f83b46f0deb40a4746a1337ffa88" => :mavericks
sha1 "b5d7094ed826813b2cc35303bcde8269b1ad9292" => :mountain_lion
# <body data-controller="dashboard/errors" data-action="index">
# -> dashboard/errors/index -> ErrorsIndex
pageClass = () ->
path = $('body').data('controller') + "/" + $('body').data('action')
className = path.replace(/(?:^(?:dashboard\/)?|\/)(.)/g, (m, l) -> l.toUpperCase())
return window[className]
$ ->
if Klass = pageClass()
new Klass($('body'))

Super-charging your views with react-rails

Abstract

Facebook's React javascript library has grown in popularity extremely quickly. The react-rails gem provides a tight integration with rails, letting you use React as your view layer.

This talk covers the pros and cons of such an approach, along with some examples of the incredible things it makes easy. In particular it describes how react-rails lets you pre-render your react templates on the server for lightning fast page-loads.

For Review Committee

require 'debug_inspector'
def a(a)
b(1)
end
def b(b)
c(2)
end