Skip to content

Instantly share code, notes, and snippets.

Prerequisitie:
Ruby 2.0.0-p481
Rails 4.1.6
[Step 1]
- rails new wids2015
[Step 2] Add following lines to Gemfile
gem 'devise'
Prerequisitie:
Ruby 2.0.0-p481
Rails 4.1.6
[Step 1]
- rails new wids2015
[Step 2] Add following lines to Gemfile
gem 'devise'
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@yachi
yachi / install.sh
Last active December 21, 2015 17:08
to start using git flow
#!/bin/sh
#
brew install git-flow
brew uninstall git
brew install git --without-completions
echo
echo
echo
echo "==================================="
@simonpang
simonpang / LoginViewController.m
Last active December 15, 2015 15:39
Dreaming of promise base API for event handling
- (id)init
{
if (self = [super initNibName:nil bundle:nil]) {
[[self whenViewDidLoad] then:^{
id loginPromise = [client login:self.loginField password:self.passwordField when:[self.loginButton whenTouchDown]];
[UIAlertView presentMessage:^{ return [loginPromise alertError]; } when:[loginPromise whenFail]];
[client saveAccessToken:[self.loginPromise whenSuccess]];
[self presentModalViewController:[RegisterViewController willCreate] when:[self.registerButton whenTouchDown]];
}];
@siuying
siuying / gist:3300356
Created August 9, 2012 02:19
Rams' ten principles of "good design"

Rams' ten principles of "good design"

Rams introduced the idea of sustainable development and of obsolescence being a crime in design in the 1970s. Accordingly he asked himself the question: is my design good design? The answer formed his now celebrated ten principles.

Good design:

  • Is innovative - The possibilities for innovation are not, by any means, exhausted. Technological development is always offering new opportunities for innovative design. But innovative design always develops in tandem with innovative technology, and can never be an end in itself.
  • Makes a product useful - A product is bought to be used. It has to satisfy certain criteria, not only functional, but also psychological and aesthetic. Good design emphasizes the usefulness of a product whilst disregarding anything that could possibly detract from it.
  • Is aesthetic - The aesthetic quality of a product is integral to its usefulness because products are used every day and have an effect on people and their well-being.
// Copyright (c) 2012-2013 Peter Steinberger (http://petersteinberger.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@pinglamb
pinglamb / active.js
Created June 19, 2012 13:55
Select Active Item JS
var links = document.getElementsByClassName('link');
var choose = function() {
for(var j=0; j < links.length; j++) {
links[j].className = '';
}
this.className = 'active';
};
for(var i=0; i < links.length; i++) {
links[i].addEventListener('click', choose, false);
}
@0xced
0xced / NSObject+ARCZombie.m
Created May 19, 2012 17:52
Solves the problem of .cxx_destruct methods not being called when zombies are enabled
#import <objc/runtime.h>
@implementation NSObject (ARCZombie)
+ (void) load
{
const char *NSZombieEnabled = getenv("NSZombieEnabled");
if (NSZombieEnabled && tolower(NSZombieEnabled[0]) == 'y')
{
Method dealloc = class_getInstanceMethod(self, @selector(dealloc));
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)