Skip to content

Instantly share code, notes, and snippets.

View patrickng's full-sized avatar

Patrick Ng patrickng

View GitHub Profile
@laurent22
laurent22 / javascript_warnings.md
Last active August 7, 2022 09:27
How many warnings should your JavaScript app have?

How many warnings should your JavaScript app have?

JavaScript warnings are these messages being displayed in yellow or red in your JavaScript console or terminal. They make no sense at all in general but they are a good indication of the health of your app. The points below will give you a general idea of how many warnings you should expect in your app:

  • 0 warnings: the app is not working at all

  • 5 warnings: app is probably starting but crashing soon after - try to find why it crashes. You'd think you could read the warnings to learn why it doesn't work, but that's not what warnings are for.

  • 50 warnings: That's the soft spot - most likely everything's running smoothly

@knightshrub
knightshrub / ddns.sh
Created December 29, 2017 09:47
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"
@juanarbol
juanarbol / chmodCheatSheet.md
Last active April 10, 2024 19:17
Chmod cheat sheet

Chmod codes cheat sheet

How to use chmod codes in UNIX:

  1. There are three types of permissions in files and folders in unix
    1. Read (r)
    2. Write (w)
    3. Execute (x)
  2. And, there is a classification of users called UGO (explained bellow):
  3. U ~> User (usually, you)
@splhack
splhack / python2+3.md
Created May 18, 2016 06:01
MacVim with Python 2.x and Python 3.x
  • 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 11:21 — forked from koriroys/gist:dc53d8d7034512a995bc
Added hax enabling auto filing from existing models/properties.

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 May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
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 August 15, 2018 11:30
Integrating TinyMCE in an ember-cli app

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:

@subfuzion
subfuzion / global-gitignore.md
Last active March 25, 2024 05:13
Global gitignore

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 any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@jules2689
jules2689 / README.md
Last active January 31, 2019 10:17
Tracking users' actions throughout an application in an "activity feed"

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

@jctosta
jctosta / screen_cheatsheet.markdown
Last active April 6, 2024 20:36
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r