Skip to content

Instantly share code, notes, and snippets.

View attomos's full-sized avatar
💆‍♀️

Nattaphoom Chaipreecha attomos

💆‍♀️
View GitHub Profile
@attomos
attomos / git-branches-by-commit-date.sh
Created January 20, 2017 03:03 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@attomos
attomos / sublime_text_2_useful_shortcuts.md
Created March 16, 2016 03:00 — forked from nuxlli/sublime_text_2_useful_shortcuts.md
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@attomos
attomos / destructuring.js
Created February 22, 2016 07:10 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring.
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => {
return [1, 2, 3];
@attomos
attomos / Q.js Examples
Created February 15, 2016 14:11 — forked from guptag/Q.js Examples
Q.js examples - Small snippets to understand various api methods in Q.js
//To run Q.js examples:
// 1. Open a new browser tab in Chrome and turn on developer toolbar.
// 2. Copy/Paste this gist in the console (opened from any http site) and hit enter to run the snippets.
// Based on the inspiration from samples @ https://github.com/kriskowal/q
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
@attomos
attomos / tmux.cheat
Last active December 15, 2015 14:13 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^a w
New -s <session> Create ^a c
Attach att -t <session> Rename ^a , <name>
Rename rename-session -t <old> <new> Last ^a l (lower-L)
Kill kill-session -t <session> Close ^a &
@attomos
attomos / irc.md
Created December 6, 2015 08:54 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@attomos
attomos / GitForWindowsSetup.md
Last active August 29, 2015 14:27 — forked from dmangiarelli/GitForWindowsSetup.md
How to setup Git for Windows

How to setup Git for Windows

I know this document seems long, but it shouldn't be too difficult to follow. This guide is based on Windows, but every program here have Linux/Mac equivalents, and in most cases they're built-in. So, take a deep breath and go step by step.

The steps below are for [GitHub][github], but the steps are almost idential for Bitbucket, Heroku, etc.

Cmder

The first thing you'll want to do is to download and install [Cmder][cmder], which is a terminal program that serves as excellent replacement for the built-in cmd.exe. It's not a shell itself, so it supports running plain old cmd.exe commands and running PowerShell.

# config/locales/en.yml
en:
exception:
show:
not_found:
title: "Not Found"
description: "The page you were looking for does not exists."
internal_server_error:
title: "Internal Server Error"

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

# In your Rakefile add your font in the app setup.
Motion::Project::App.setup do |app|
# App Settings
app.fonts = ['st-marie.ttf']
end
# Make sure your st-marie.ttf is in your resources directory
# To use in your app do the following
my_font = UIFont.fontWithName 'St Marie', size: 32