Skip to content

Instantly share code, notes, and snippets.

View adam187's full-sized avatar

Adam Misiorny adam187

View GitHub Profile
//TODO: make this a module
/**
* # SockJS socket management service
*
* Creates SockJS socket connection to server, re-connects on disconnection,
* and exports hooks to map handlers for various data interactions.
*
*/
angular.module('app').factory
apt-get update
apt-get install -q -y python-software-properties
add-apt-repository ppa:ondrej/php5
add-apt-repository ppa:chris-lea/node.js
apt-get install -q -y php5 php5-fpm php5-mssql php5-gd php5-imagick php5-mysql php5-curl php5-cli php5-pgsql
apt-get remove -q -y apache2
apt-get install -q -y nginx mysql-server git curl nodejs
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html
MyEntity:
type: entity
repositoryClass: MyRepositoryClass
table: my_entity
namedQueries:
all: "SELECT u FROM __CLASS__ u"
# Class-Table-Inheritance
@adam187
adam187 / console
Created May 31, 2015 10:10
symfony app console with deprecated errors silenced
#!/usr/bin/env php
<?php
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
set_time_limit(0);
require_once __DIR__.'/bootstrap.php.cache';
@adam187
adam187 / angularjs_directive_attribute_explanation.md
Created October 14, 2015 08:48 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@adam187
adam187 / backupMongo_bucket.sh
Created October 24, 2016 14:38 — forked from njadhav1/backupMongo_bucket.sh
Backup MongoDB collection and upload to AWS s3
#!/bin/bash
########
# Purpose :- To take a backup of MongoDB Collections and upload to AWS s3
# Requirement :- Make Sure Collection.config file is present in /data/Backup/mongodb
# format for Collection.config is db|collection
# For example
# db1|collections1
#!/bin/bash
if [ "$GIT_SSH_KEY" != "" ]; then
echo "Cleaning up SSH config" >&1
echo "" >&1
# Now that npm has finished running,
# we shouldn't need the ssh key/config anymore.
# Remove the files that we created.
rm -f ~/.ssh/config
rm -f ~/.ssh/deploy_key
#/bin/bash
# Fail on first error
set -e
APP=${1?dokku app name required}
MAILCATCHER_APP=mailcatcher-${APP}
MAILCATCHER_APP_DOCKER_NAME=${MAILCATCHER_APP}.web.1
MAILCATCHER_HOST=${MAILCATCHER_APP}
MAILCATCHER_SMTP_PORT=1025