Skip to content

Instantly share code, notes, and snippets.

View makzan's full-sized avatar
🎯
Focusing

Thomas Seng Hin Mak makzan

🎯
Focusing
View GitHub Profile
@makzan
makzan / UIDevice+hardware.m
Created August 18, 2011 10:46
Getting iPhone device model
#import "UIDevice+hardware.h"
#include <sys/types.h>
#include <sys/sysctl.h>
@implementation UIDevice (Hardware)
/*
Platforms
iPhone1,1 -> iPhone 1G
iPhone1,2 -> iPhone 3G
@makzan
makzan / radar.css
Created November 6, 2011 17:41
Rotatable radar in HTML and CSS
html, body{
background: transparent;
}
ul,li{
margin:0;
list-style:none;
}
li {
@makzan
makzan / gist:1963105
Created March 3, 2012 00:59
Logging to Day One from git commit
# modification code for the "git to log commits to Day One"
# at http://brettterpstra.com/logging-with-day-one-geek-style/
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
}
# And use the branch name in the log message
GIT_DIR=$(parse_git_branch)
@makzan
makzan / using-foundation-reveal.js
Created August 22, 2012 08:14
About Using Reveal Modal in Zurb Foundation CSS Framework
// About Using Reveal Modal in Zurb Foundation CSS Framework
// Show a modal (documented in Foundation doc)
$('#modal').reveal(options)
// The followings are not documented in Foundation doc.
// Close a modal
$('#modal').trigger('reveal:close');
// Close all modal
@makzan
makzan / disable-anti-alias-in-st2.txt
Created August 22, 2012 12:28
Disable anti-alias in Sublime Text 2
{
"font_options":
[
"no_antialias"
]
}
@makzan
makzan / Rakefile
Created September 12, 2012 15:25
Rakefile to preview and build wintersmith blog
desc 'Help'
task :default do
puts 'rake preview - Preview the site'
puts 'rake build - Build the stie into static files'
puts 'rake push - Push to heroku'
end
desc 'Preview the site'
task :preview do
exec 'wintersmith preview -C wintersmith -p 1234'
@makzan
makzan / dabblet.css
Created December 21, 2012 14:57
Untitled
#content {
border: 2px solid green;
position: relative;
margin: 10px;
margin-top: 100px;
height: 24px;
line-height: 24px;
}
#content:after {
@makzan
makzan / gist:4452726
Created January 4, 2013 13:50
code snippet of the next and current sliding transition.
.next, .current {
transition: all 0.5s ease-out;
}
#routes.rb
get "blog/category/:category/" => "posts#by_category", as: :post_category
get "blog/category/:category/index.html" => "posts#by_category"
get "blog/page-:page/" => "posts#index", as: :blog
get "blog/page-:page/index.html" => "posts#index"
get "blog/:slug/" => "posts#by_slug", as: :post_slug
get "blog/:slug/index.html" => "posts#by_slug"
get "blog" => "posts#index", as: :blog
get "blog/index.html" => "posts#index"
@makzan
makzan / cm436-ror-lesson1.md
Created September 5, 2013 04:08
Ruby on Rails Lesson 1