Skip to content

Instantly share code, notes, and snippets.

View patrickng's full-sized avatar

Patrick Ng patrickng

View GitHub Profile

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@patrickng
patrickng / cloudSettings
Last active February 9, 2021 14:36
VSCode Settings
{"lastUpload":"2021-02-09T14:36:11.657Z","extensionVersion":"v3.4.3"}
@patrickng
patrickng / chmodCheatSheet.md
Created March 6, 2019 16:22 — forked from juanarbol/chmodCheatSheet.md
Chmod cheat sheet

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):
  3. U ~> User (usually, you)
@patrickng
patrickng / ddns.sh
Created December 27, 2018 16:08 — forked from knightshrub/ddns.sh
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.
#!/bin/bash
# This script makes it possible to update a Namecheap dynamic DNS
# A record automatically using a cron job
# configure these
dnshost="host"
dnsdomain="example.com"
dnspw="longasspasswd"
@patrickng
patrickng / README.md
Last active November 17, 2017 22:24
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
patrickng / brew-unlink_relink.sh
Created November 16, 2016 03:46 — forked from fijimunkii/brew-unlink_relink.sh
brew: unlink and re-link all formulas and kegs
@patrickng
patrickng / redis-one-line--pattern-delete.sh
Last active November 9, 2016 22:01 — forked from MattSurabian/redis-one-line--pattern-delete.sh
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
@patrickng
patrickng / gulpfile.js
Last active August 29, 2015 14:18
Gulp SASS + BrowserSync + JS
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var reload = browserSync.reload;
@patrickng
patrickng / gulpfile.js
Last active January 25, 2018 01:17
Gulp SASS + Live Reload + JS
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
autoprefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
var onError = function (err) {
location / {
# JSONP-support
if ( $arg_callback ) {
echo_before_body '$arg_callback(';
echo_after_body ');';
}
}