Skip to content

Instantly share code, notes, and snippets.

View alexpchin's full-sized avatar

Alex Chin alexpchin

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@alexpchin
alexpchin / A_story_explaining_mvc.md
Last active August 29, 2015 14:01
A story explaining MVC

A story explaining MVC

MVC stands for:

  • Models
  • Views
  • Controllers

It’s more fun to imagine the explainatin of MVC as a story with “a fat assistant, a skinny manager and a good looking sales rep" (fat model, skinny controller and well designed view) rather than a boring “3-tiered MVC architecture”.

@alexpchin
alexpchin / Rails_CMS_Overview.md
Last active August 29, 2015 14:02
Looking for a Decent Rails CMS

Rails Content Management Systems

When developing websites for small to medium clients, often a decent CMS is needed to get basic CRUD functionality and authentication off the ground quickly.

I've done a little bit of research into some of the most popular CMS platforms. Here are my quick thoughts.

1. Browser CMS

@alexpchin
alexpchin / Deploying_to_Heroku
Last active August 29, 2015 14:02
Deploying to Heroku
Deploying to Heroku
==================
group :production do
gem 'rails_12factor'
end
# Enable the asset pipeline
config.assets.enabled = true
config.assets.initialize_on_precompile = false
@alexpchin
alexpchin / HAML_the_unforgivable_sin.md
Created June 2, 2014 21:45
HAML: the unforgivable sin

HAML: the unforgivable sin

Repost from: http://opensoul.org/2011/11/30/haml-the-unforgivable-sin/

I used HAML on several client projects and I hated it every time. There are certainly some things that are nice about it, but overall it is a net loss.

##For abstraction’s sake Abstractions are a beautiful thing. The goal of an abstraction is to reduce or factor out irrelevant details. Removing details focuses you on the problem at hand and not the underlying implementation.

@alexpchin
alexpchin / Check_Filesize_in_Terminal.md
Created June 17, 2014 10:40
Check Filesize in Terminal

du -sh *

@alexpchin
alexpchin / Meta Tags
Last active August 29, 2015 14:02
Meta Tags
<!-- for Google -->
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="copyright" content="" />
<meta name="application-name" content="" />
<!-- for Facebook -->
<meta property="og:title" content="" />
<meta property="og:type" content="article" />
@alexpchin
alexpchin / DefaultKeyBinding.dict
Created August 4, 2014 08:52
DefaultKeyBinding.dict
{
/* Map # to § key*/
"§" = ("insertText:", "#");
}

true and false vs. "truthy" and "falsey" (or "falsy") in Ruby, Python, and JavaScript

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).

This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.

If you want to use or share this material, please see the license file, below.

Update

@alexpchin
alexpchin / Sublime_3_Keyboard_Shortcuts.md
Created March 15, 2015 19:41
Sublime 3 Keyboard Shortcuts
Keypress Action
cmd + s save changes in current file - DO IT OFTEN!!!
cmd + q close Sublime
cmd + w close one file at a time
cmd + alt + arrow switch between files
cmd + numbers also switch between specific files
cmd + f search in you current file
cmd + shift + f search the entire project
cmd + d go to next searched word in file