This file contains 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
<?php | |
function unzip($file) { | |
$zip = zip_open($file); | |
if (is_resource($zip)) { | |
$tree = ""; | |
while (($zip_entry = zip_read($zip)) !== false) { | |
echo "Unpacking " . zip_entry_name($zip_entry) . "\n"; | |
if (strpos(zip_entry_name($zip_entry), DIRECTORY_SEPARATOR) !== false) { | |
$last = strrpos(zip_entry_name($zip_entry), DIRECTORY_SEPARATOR); | |
$dir = substr(zip_entry_name($zip_entry), 0, $last); |
This file contains 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
(function($) { | |
var settings = { | |
hoverClass: 'sUpload-hover', | |
dropAreaClass: 'sUpload-drop', | |
dropMessage: 'Drop file here!', | |
dropAreaHeight: 200, uploadURL: null, | |
fileReaderCallback: null, | |
fileUploadCallback: null, | |
errorCallback: null | |
}, |
This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
# No need to sync the vagrant folder, everything gets deployed | |
# with the ansible playbook |
This file contains 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
- name: link to Keymetrics | |
command: pm2 link {{ keymetrics_secret_key }} {{ keymetrics_public_key }} | |
when: keymetrics | |
become: yes | |
become_user: apps | |
ignore_errors: yes |
This file contains 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
tasks: | |
- name: install nginx | |
apt: name=nginx state=present update_cache=yes | |
notify: | |
- start nginx | |
- name: configure nginx | |
copy: src={{ item }} dest=/etc/nginx/sites-available/ | |
with_fileglob: | |
- ./nginx/* | |
notify: |
This file contains 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
location /app { | |
proxy_pass http://localhost:3001; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} |
This file contains 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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name localhost; |
This file contains 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
location /app { | |
proxy_pass http://localhost:3001; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} |
This file contains 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
--- | |
- hosts: all | |
sudo: yes | |
vars: | |
# list of apps to be managed by pm2 | |
pm2_apps: | |
- /var/apps/services/app.js | |
- /var/apps/services/otherapp.js | |
# franklinkim.nodejs |
This file contains 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
--- | |
- hosts: all | |
sudo: yes | |
vars: | |
# list of apps to be managed by pm2 | |
pm2_apps: | |
- /var/apps/services/app.js | |
- /var/apps/services/otherapp.js | |
# franklinkim.nodejs |