Skip to content

Instantly share code, notes, and snippets.


Jim Chang zxcvbnm4709

View GitHub Profile
zxcvbnm4709 / gist:2656197
Created May 10, 2012
include jQuery in Chrome Console
View gist:2656197
var script = document.createElement("script");
script.setAttribute("src", "");
script.addEventListener('load', function() {
var script = document.createElement("script");
}, false);
zxcvbnm4709 / monitrc
Created Jun 25, 2012
Edit monit configuration file in /etc/monit/monitrc
View monitrc
set daemon 120
set logfile syslog facility log_daemon
set mailserver port 587 username "" password "userpassword" using tlsv1,
with timeout 15 seconds
set eventqueue
basedir /var/monit
slots 1000
View PlacesViewController.m
#import "HFAppDelegate+FBAuthentication.h"
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
zxcvbnm4709 / gist:3968572
Created Oct 28, 2012
response from heroku in console
View gist:3968572
<!DOCTYPE html>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
zxcvbnm4709 /
Created Jun 2, 2012 — forked from mislav/
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

zxcvbnm4709 / dabblet.css
Created May 12, 2012 — forked from jackie/dabblet.css
FizzBuzz with CSS
View dabblet.css
* FizzBuzz with CSS
body {
counter-reset: fizzbuzz;
div {
View dabblet.html
<!-- content to be placed inside <body>…</body> -->
zxcvbnm4709 / RKObjectMapping.h
Created Jan 17, 2012
understanding object mapping of RestKit
View RKObjectMapping.h
// RKObjectMapping.h
// RestKit
// Created by Blake Watters on 4/30/11.
// Copyright 2011 Two Toasters. All rights reserved.
#import <Foundation/Foundation.h>
#import "RKObjectMappingDefinition.h"
zxcvbnm4709 / gist:1399495
Created Nov 28, 2011
heroku logs 爆炸
View gist:1399495
2011-11-28T07:34:52+00:00 app[web.1]: => Booting WEBrick
2011-11-28T07:34:52+00:00 app[web.1]: => Rails 3.1.0 application starting in production on
2011-11-28T07:34:52+00:00 app[web.1]: => Call with -d to detach
2011-11-28T07:34:52+00:00 app[web.1]: => Ctrl-C to shutdown server
2011-11-28T07:34:52+00:00 app[web.1]:
2011-11-28T07:34:52+00:00 app[web.1]:
2011-11-28T07:34:52+00:00 app[web.1]: Started GET "/" for at 2011-11-28 07:34:52 +0000
2011-11-28T07:34:52+00:00 app[web.1]: Processing by PollsController#index as HTML
2011-11-28T07:34:52+00:00 app[web.1]: Rendered common/_user_nav.html.erb (1.2ms)
You can’t perform that action at this time.