This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: node:6.10.3 | |
| stages: | |
| - init | |
| - tests | |
| - deploy | |
| - production | |
| init: | |
| stage: init |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Anh Nguyen <anh.ng8@gmail.com> | |
| # 2016-04-30 | |
| # MIT License | |
| # This script takes in images from a folder and make a crossfade video from the images using ffmpeg. | |
| # Make sure you have ffmpeg installed before running. | |
| # The output command looks something like the below, but for as many images as you have in the folder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a template .gitignore file for git-managed WordPress projects. | |
| # | |
| # Fact: you don't want WordPress core files, or your server-specific | |
| # configuration files etc., in your project's repository. You just don't. | |
| # | |
| # Solution: stick this file up your repository root (which it assumes is | |
| # also the WordPress root directory) and add exceptions for any plugins, | |
| # themes, and other directories that should be under version control. | |
| # | |
| # See the comments below for more info on how to add exceptions for your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: node:latest | |
| stages: | |
| - build | |
| - deploy | |
| before_script: | |
| - npm install mocha | |
| install_dependencies: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // USAGE: | |
| // abbrState('ny', 'name'); | |
| // --> 'New York' | |
| // abbrState('New York', 'abbr'); | |
| // --> 'NY' | |
| function abbrState(input, to){ | |
| var states = [ | |
| ['Arizona', 'AZ'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add to .gitignore file | |
| node_modules | |
| Then call: | |
| git rm -r --cached node_modules | |
| git commit -m "Remove node_modules now that they're ignored!" | |
| git push origin master |
A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var util = require('util'), | |
| winston = require('winston'), | |
| logger = new winston.Logger(), | |
| production = (process.env.NODE_ENV || '').toLowerCase() === 'production'; | |
| module.exports = { | |
| middleware: function(req, res, next){ | |
| console.info(req.method, req.url, res.statusCode); |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers