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
| var AWS = require('aws-sdk'), | |
| fs = require('fs'); | |
| // http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
| AWS.config.loadFromPath('./aws-config.json'); | |
| // assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
| var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
| function uploadToS3(file, destFileName, callback) { |
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
| # /etc/nginx/sites-enabled/ | |
| server { | |
| server_name domain.tld www.domain.tld; | |
| root /var/www/project/web; | |
| location / { | |
| # try to serve file directly, fallback to app.php | |
| try_files $uri /app.php$is_args$args; | |
| } | |
| # DEV |
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
| Dockerfile | |
| config.xml | |
| .sass-cache | |
| .editorconfig | |
| .io-config.json | |
| .dockerignore | |
| hooks/ | |
| platforms/ | |
| node_modules/ |
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
| # The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk. | |
| # Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config) | |
| # -------------------------------- Commands ------------------------------------ | |
| # Use "commands" key to execute commands on the EC2 instance. The commands are | |
| # processed in alphabetical order by name, and they run before the application | |
| # and web server are set up and the application version file is extracted. | |
| # ------------------------------------------------------------------------------ | |
| commands: | |
| 01updateComposer: |
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
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
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 | |
| # Functions ============================================== | |
| # return 1 if global command line program installed, else 0 | |
| # example | |
| # echo "node: $(program_is_installed node)" | |
| function program_is_installed { | |
| # set to 1 initially | |
| local return_=1 |
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
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
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
| RB.filter('daterange', function () | |
| { | |
| return function(conversations, start_date, end_date) | |
| { | |
| var result = []; | |
| // date filters | |
| var start_date = (start_date && !isNaN(Date.parse(start_date))) ? Date.parse(start_date) : 0; | |
| var end_date = (end_date && !isNaN(Date.parse(end_date))) ? Date.parse(end_date) : new Date().getTime(); |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>AngularJS Sorting & Filtering Example</title> | |
| <style type="text/css"> | |
| body{ font:12px arial, sans-serif; line-height:1.6em; margin:0 auto; max-width:960px; } |
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
| /** | |
| * Function to flatten a multi-dimensional array and return an array | |
| * containing the unique values on the array as a single array. | |
| * @param $array | |
| * | |
| * @return array | |
| */ | |
| function flatten_array($array) | |
| { |
NewerOlder