Skip to content

Instantly share code, notes, and snippets.

View ThinhPhan's full-sized avatar
🎯
Focusing

Thinh Phan ThinhPhan

🎯
Focusing
View GitHub Profile

WPE Issues

OpenGL

Read more OpenGL Error

  • glGetError 0x502 : means invalid operation
  • glGetError 0x505 : means out-of-memory reported by the opengl gpu driver --> Solution: Share more memory to GPU
@ThinhPhan
ThinhPhan / cmdline.txt
Created July 30, 2018 20:11
Raspi config.txt full description from Resin.io
dwc_otg.lpm_enable=0 console=null root=LABEL=resin-rootA rootfstype=ext4 rootwait vt.global_cursor_default=0
@ThinhPhan
ThinhPhan / keybase.md
Created September 10, 2018 10:52
Keybase.io Public key

Keybase proof

I hereby claim:

  • I am ThinhPhan on github.
  • I am vincentphan (https://keybase.io/vincentphan) on keybase.
  • I have a public key whose fingerprint is DD84 89C3 55B3 FDD0 201E 4E48 E6B6 FB5E 0726 1456

To claim this, I am signing this object:

@ThinhPhan
ThinhPhan / README.md
Created September 18, 2018 13:41
Demo npx

Hello World

This is how npx work. Enjoy yourself.

Copy the URL above on your browser's address npx [YOUR-AWESOME-GIST-URL]

@ThinhPhan
ThinhPhan / chmod.md
Last active February 21, 2019 06:56
Linux - chmod for dummy

What is the difference between “chmod +x” and “chmod 755”?

Motivate from this question and answer https://askubuntu.com/a/932719/927010

Short version:

To be able to compare them, we should look at them from the same perspective, so:

chmod +x is equal to chmod ugo+x (Based on umask value) chmod 755 is equal to chmod u=rwx,go=rx

@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"}