Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile
@jhsu
jhsu / vimrc.markdown
Last active December 10, 2015 21:59
netrw + nerdtree to navigate files in buffer rather than in a drawer.

Inspired by vimcast article

Open file browser in curent buffer

This makes it more clear which split a file will be opened in.

Use rbgrouleff/bclose.vim to close the buffer and not break splits.

#!/usr/bin/env ruby
class Blink1
def self.list
native(["--list"]).select {|l| l =~ /^id/ }
end
def self.ids
list.map {|info| info[/^id:(\d+)/]; $1 }
end
@jhsu
jhsu / rails_template.rb
Created December 1, 2012 18:02
Rails template
# Generate home controller
File::unlink "public/index.html"
generate(:controller, "home index about contact")
route "root :to => 'home#index'"
# Install gem
## Access
gem "devise"
gem "cancan"
@jhsu
jhsu / index.html
Created November 6, 2012 20:29
A CodePen by Joseph Hsu.
<html>
<body data-type="background" speed="8">
<div id="content">
<section id="whoami">
<article>
<h2>Joseph <abbr title="/shoe/">Hsu</abbr></h2>
<p>
<strong>Web Developer</strong>.
</p>
</article>
@jhsu
jhsu / index.html
Created November 6, 2012 20:29
A CodePen by Joseph Hsu.
<html>
<body data-type="background" speed="8">
<div id="content">
<section id="whoami">
<article>
<h2>Joseph <abbr title="/shoe/">Hsu</abbr></h2>
<p>
<strong>Web Developer</strong>.
</p>
</article>
@jhsu
jhsu / index.html
Created November 5, 2012 19:12
A CodePen by Joseph Hsu.
<html>
<body data-type="background" speed="8">
<div id="content">
<section id="whoami">
<article>
<h2>Joseph <abbr title="/shoe/">Hsu</abbr></h2>
<p>
Web developer.
</p>
</article>
@jhsu
jhsu / index.html
Created November 5, 2012 19:12
A CodePen by Joseph Hsu.
<html>
<body data-type="background" speed="8">
<div id="content">
<section id="whoami">
<article>
<h2>Joseph <abbr title="/shoe/">Hsu</abbr></h2>
<p>
Web developer.
</p>
</article>
@jhsu
jhsu / hipchat.css
Created October 3, 2012 14:05
Limechat Hipchat adjustments
.sender[type=myself] { color: #45537f; font-weight: bold; }
.sender[type=normal] { color: #636363; font-weight: normal; }
.sender[type=normal][colornumber='0'] { color: #cccc00; }
.sender[type=normal][colornumber='1'] { color: #cc00cc; }
.sender[type=normal][colornumber='2'] { color: #00cccc; }
.sender[type=normal][colornumber='3'] { color: #00cc00; }
.sender[type=normal][colornumber='4'] { color: #cc0000; }
.sender[type=normal][colornumber='5'] { color: #0000cc; }
.sender[type=normal][colornumber='6'] { color: #000000; }
.sender[type=normal][colornumber='7'] { color: #88cc00; }
require 'hyper_api'
class Api::BaseController < ApplicationController
respond_to :json
self.responder = Authentication::Responders::HyperApi
end
@jhsu
jhsu / example_1.rb
Created September 19, 2012 00:39
code samples for blog post
thing = ThingDecorator.decorate(Thing.where(:name => "name"))
thing.first.class #=> Thing # undecorated instance