Skip to content

Instantly share code, notes, and snippets.

View linjunpop's full-sized avatar
👻
🤗

Jun Lin linjunpop

👻
🤗
View GitHub Profile
@linjunpop
linjunpop / github-time-tracking-chrome-extension.js
Last active December 17, 2015 01:49
Github time tracking Chrome extension for AC.
chrome.tabs.query(
{'active': true, 'currentWindow': true},
function (tabs) {
var tab = tabs[0]
var url = tab.url;
var title = tab.title;
var pattern = /https:\/\/github.com\/pracstrat\/(\w+)\/issues\/(\w+)/
var search = tab.url.match(pattern)
jQuery.ajax({
@linjunpop
linjunpop / content-type.rb
Created May 8, 2013 02:14
Get file content type from filename.
filename = 'foobar.zer.png'
def content_type
extname = File.extname(filename)[1..-1]
Mime::Type.lookup_by_extension(extname)
end
@linjunpop
linjunpop / Gemfile
Created May 10, 2013 00:52
Carrierwave-mongoid with mongoid 4
gem 'carrierwave-mongoid', github: 'jnicklas/carrierwave-mongoid'
gem 'mongoid', github: 'mongoid/mongoid'
@linjunpop
linjunpop / Gemfile.lock
Last active December 17, 2015 04:48
https://github.com/dockyard/postgres_ext Integer Array save with String value.
rails (3.2.13)
pg (0.14.1)
pg_array_parser (0.0.8)
postgres_ext (0.3.1)
activerecord (~> 3.2.0)
pg_array_parser (~> 0.0.8)
@linjunpop
linjunpop / Objective-C-for-Rubyist.md
Last active November 28, 2018 12:18
Objective-C for Rubyist.

Objective-C for Rubyist

Basic Syntax

Message

[you say:@"Hello."];
@linjunpop
linjunpop / a.m
Created May 31, 2013 07:42
Objective-C dynamic selector
NSString *a = @"bar";
NSString *aSelector = @"uppercaseString";
NSString *b = [a performSelector:NSSelectorFromString(aSelector)];
//NSString *b = objc_msgSend(a, NSSelectorFromString(aSelector));
NSLog(@"b: %@", b);
//=> b: "BAR"
@linjunpop
linjunpop / helvetica-nenu-ultralight.css
Created June 14, 2013 05:17
Helvetica Neue UltraLight
body {
font-family: 'HelveticaNeue-UltraLight', 'Helvetica Neue UltraLight', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 100;
letter-spacing: 1px;
}
@linjunpop
linjunpop / metadata.xml
Last active December 19, 2015 22:38
iTunes Connect App metadata
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://apple.com/itunes/importer" version="software5.1">
<team_id>TEAM-ID</team_id>
<software>
<vendor_id>VENDOR-ID</vendor_id>
<software_metadata>
<versions>
<version string="1.1.3">
<locales>
<locale name="en-US">
@linjunpop
linjunpop / deploy-rails-4-app-with-dokku-on-digital-ocean.md
Last active September 11, 2024 10:21
Deploy Rails 4 app with Dokku on DigitalOcean

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@linjunpop
linjunpop / README.md
Last active December 23, 2015 15:49
iOS 7 Safari Notes

CSS font values

-apple-system-headline1
-apple-system-headline2
-apple-system-body
-apple-system-subheadline1
-apple-system-subheadline2
-apple-system-footnote
-apple-system-caption1