Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Thomas Seng Hin Mak makzan

🎯
Focusing
View GitHub Profile
@makzan
makzan / UIDevice+hardware.m
Created Aug 18, 2011
Getting iPhone device model
View UIDevice+hardware.m
#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 Nov 6, 2011
Rotatable radar in HTML and CSS
View radar.css
html, body{
background: transparent;
}
ul,li{
margin:0;
list-style:none;
}
li {
@makzan
makzan / gist:1963105
Created Mar 3, 2012
Logging to Day One from git commit
View gist:1963105
# 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 Aug 22, 2012
About Using Reveal Modal in Zurb Foundation CSS Framework
View using-foundation-reveal.js
// 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 Aug 22, 2012
Disable anti-alias in Sublime Text 2
View disable-anti-alias-in-st2.txt
{
"font_options":
[
"no_antialias"
]
}
@makzan
makzan / Rakefile
Created Sep 12, 2012
Rakefile to preview and build wintersmith blog
View Rakefile
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'
View dabblet.css
#content {
border: 2px solid green;
position: relative;
margin: 10px;
margin-top: 100px;
height: 24px;
line-height: 24px;
}
#content:after {
@makzan
makzan / gist:4452726
Created Jan 4, 2013
code snippet of the next and current sliding transition.
View gist:4452726
.next, .current {
transition: all 0.5s ease-out;
}
View gist:6308601
#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"