Skip to content

Instantly share code, notes, and snippets.

Patrick Ng patrickng

Block or report user

Report or block patrickng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Chmod codes cheat sheet

How to use chmod codes in UNIX:

  1. There are three types of permisions in files and folders in unix
    1. Read (r)
    2. Write (w)
    3. Execute (x)
  2. And, there is a clasificacion of users called UGO (explained bellow):
    1. U ~> User (usually, you)
patrickng /
Created Dec 27, 2018 — forked from knightshrub/
This script can be used to update a Namecheap dynamic DNS A record from a cron job. This is useful when the host does not have a static IP e.g. when sitting behind a DSL modem and being assigned an IP by the ISP via DHCP.
# This script makes it possible to update a Namecheap dynamic DNS
# A record automatically using a cron job
# configure these
patrickng /
Last active Nov 17, 2017 — forked from williamhaley/
SR FED Code Challenge

SR FED Code Challenge

We want to see your skills related to taking a design and implementing it in html/css, reading Ember documentation and putting together a simple app, breaking the html into components, loading dynamic data.

We've set up an Ember environment that bootstraps and configures an Ember app with everything you need. Feel free to work on it by either forking the Twiddle or downloading the code and editing it locally, whichever you are more comfortable with.

  1. Please take the design in the attached file and implement it using modern html and css.
  2. Integrate the html and css into the ember app by customizing the template in templates/application.hbs
  3. Make a get request to "/activities" in routes/application.js when the application loads and send that data to your template
  4. Load the data from your request into the card components inside your template. You may choose to simply include the HTML markup in a loop or use a component. That's your call!
patrickng /
Created Nov 16, 2016 — forked from fijimunkii/
brew: unlink and re-link all formulas and kegs
patrickng /
Last active Nov 9, 2016 — forked from MattSurabian/
One liner for deleting based on a pattern in redis. KEYS supports wildcards, delete doesn't. No worries xargs to the rescue. You might not need HOST, or PORT depending on your setup. You might need to sudo BOTH commands depending on your setup.
redis-cli -h <HOST> -p <PORT> KEYS <PATTERN> | xargs redis-cli -h <HOST> -p <PORT> DEL
View jsonp.txt
location / {
# JSONP-support
if ( $arg_callback ) {
echo_before_body '$arg_callback(';
echo_after_body ');';
View monit.conf
# This is an event.d (upstart) script to keep monit running.
# To install disable the old way of doing things:
# /etc/init.d/monit stop && update-rc.d -f monit remove
# then put this script here:
# /etc/init/monit.conf
# and reload upstart configuration:
View ko-persist.js
ko.extenders.persist = function (target, option) {
target.subscribe(function (newValue) {
window.localStorage.setItem(option, newValue);
return target;
//and use it like this:
var item = ko.observable().extend({persist:"storedItem"});
View truecrypt_fix.bash
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i32.2.dylib" \
"/usr/local/lib/libosxfuse_i64.2.dylib" \
"/usr/local/lib/libmacfuse_i64.2.dylib" \
"/usr/local/lib/" \
"/usr/local/lib/" \
"/usr/local/lib/pkgconfig/osxfuse.pc" )
You can’t perform that action at this time.