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
@knightshrub
knightshrub / ddns.sh
Created Dec 29, 2017
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.
View ddns.sh
#!/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"
@juanarbol
juanarbol / chmodCheatSheet.md
Last active Nov 30, 2019
Chmod cheat sheet
View chmodCheatSheet.md

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)
@splhack
splhack / python2+3.md
Created May 18, 2016
MacVim with Python 2.x and Python 3.x
View python2+3.md
  • Install python 2.7.11

command line

$ PYTHON_CONFIGURE_OPTS="--enable-shared" \
    LDSHARED="clang -bundle" \
    LDCXXSHARED="clang++ -bundle" \
    BLDSHARED="clang -bundle -lpython2.7" \
    pyenv install 2.7.11
@neciu
neciu / gist:6bfeab3e3ae38638d8fb
Last active May 23, 2017 — forked from koriroys/gist:dc53d8d7034512a995bc
Added hax enabling auto filing from existing models/properties.
View gist:6bfeab3e3ae38638d8fb

Integrating TinyMCE in an ember-cli app

TinyMCE is a javascript WYSIWYG editor that is highly configurable and has a ton of features and plugins. It integrates with jQuery and, with a bit of work, it can be integrated in your ember-cli app.

Step 1: Install TinyMCE:

bower install --save tinymce

Step 2: Import the required files into your app via broccoli. In order to do that you will need a plugin called broccoli-static-compiler:

@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active Jul 10, 2018
Ruby puma.gem install on El Capitan / Mac Sierra
View gist:0e99ea8305a20737f562
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
@mihai-scurtu
mihai-scurtu / gist:4a488007cfd150f09a4d
Last active Aug 15, 2018
Integrating TinyMCE in an ember-cli app
View gist:4a488007cfd150f09a4d

Integrating TinyMCE in an ember-cli app

TinyMCE is a javascript WYSIWYG editor that is highly configurable and has a ton of features and plugins. It integrates with jQuery and, with a bit of work, it can be integrated in your ember-cli app.

Step 1: Install TinyMCE:

bower install --save tinymce

Step 2: Import the required files into your app via broccoli. In order to do that you will need a plugin called broccoli-static-compiler:

@jules2689
jules2689 / README.md
Last active Jan 31, 2019
Tracking users' actions throughout an application in an "activity feed"
View README.md

What this does

This is the initial code. Improvements are likely to be had.

  • This creates an activity feed that can track updates, destroys, creates in a MySQL database.
  • This is inspired by part of the "public_activity" gem.
  • For Updates, what changed will be automatically stored as a hash.
  • Bootstrap's usage is assumed, as is Devise's "current_user". ActiveRecord must be used as well. These can easily be changed however.

How to use it

@thmain
thmain / MyReactComponent.js
Last active Nov 12, 2018
Skeleton React Component with descriptions for all of its lifecycle methods
View MyReactComponent.js
/**
* @jsx React.DOM
*/
var React = require('react'),
MyReactComponent = React.createClass({
// The object returned by this method sets the initial value of this.state
getInitialState: function(){
return {};
@xypaul
xypaul / tinymce-ember.js
Created May 14, 2014
TinyMCE 4 Ember Component
View tinymce-ember.js
App.TinymceEditorComponent = Ember.Component.extend({
// Warning!!! only use tinyMCE not tinymce !!!
editor: null,
data: {},
watchData: true,
didInsertElement: function(){
var _this = this;
// The magic config - http://www.tinymce.com/wiki.php/Configuration
var config = {};
@fijimunkii
fijimunkii / brew-unlink_relink.sh
Created Apr 11, 2014
brew: unlink and re-link all formulas and kegs
View brew-unlink_relink.sh
You can’t perform that action at this time.