Skip to content

Instantly share code, notes, and snippets.

View ThinhPhan's full-sized avatar
🎯
Focusing

Thinh Phan ThinhPhan

🎯
Focusing
View GitHub Profile
@ThinhPhan
ThinhPhan / .gitignore-full-description
Last active August 29, 2015 14:09 — forked from adamgit/.gitignore
Xcode .gitignore file with full description.
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@ThinhPhan
ThinhPhan / ios-locale-identifiers.csv
Last active October 17, 2015 04:12 — forked from jacobbubu/ioslocaleidentifiers.csv
Country code in iOS
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Locale Country
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
@ThinhPhan
ThinhPhan / Instructions.md
Created October 17, 2017 10:24 — forked from mcfadden/Instructions.md
Making an IP camera with the Raspberry Pi Including on-board motion detection, and a password protected web server for viewing the camera stream

Making an IP camera with the Raspberry Pi

Including on-board motion detection

Requirements

  • Raspberry Pi (512MB rev2 recommended)
  • Raspberry Pi Camera board
  • SD Card (min 2BG, 8GB recommended for good measure. Class 10)

Optionally, a wifi adapter verified to work with raspberry pi ( I used Edimax Wireless Nano USB Adapter - http://www.amazon.com/gp/product/B005CLMJLU/ )

@ThinhPhan
ThinhPhan / curl.md
Created April 5, 2019 16:14 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

Resourceful Routing for CRUD Operations in Web Applications

Note: The RESTful routes also apply to RESTful APIs, however JSON is returned to the client vs. HTML

RESTful Routes:

HTTP Verb Path (endpoint) controller#action View to Render
or Redirect
Purpose
GET /posts posts#index index List all posts
GET /posts/:id posts#show show Show a single post
@ThinhPhan
ThinhPhan / gitflow-breakdown.md
Created April 5, 2019 16:23 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@ThinhPhan
ThinhPhan / postgres-cheatsheet.md
Created April 5, 2019 16:23 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ThinhPhan
ThinhPhan / bash-string-manipulation-cheatsheet.md
Last active May 19, 2019 03:40 — forked from magnetikonline/README.md
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set. Value will be returned.

Couple with : no-op if return value is to be discarded.
${variable="value"}
: ${variable="value"}
@ThinhPhan
ThinhPhan / tmux-cheatsheet.markdown
Created April 5, 2019 16:37 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname