Skip to content

Instantly share code, notes, and snippets.

View nanlabsweb's full-sized avatar

nanlabsweb

View GitHub Profile
<div class="tile">
<h4><strong>1/3</strong></h4>
<h1 class="composed-title brand-dark"><small>Software</small> Solutions</h1>
<p>We design and handcraft custom software solutions, including social networks, websites, e-commerce, CMS, scanning and automatization processes. From elegant and intuitive interfaces to complex automated processes, <strong>we have it covered!</strong></p>
</div>
<div class="tile">
<h4>Case Study #02</h4>
<h2 class="brand-dark"><strong>Digital</strong> Marketing</h2>
<p>We worked with Omnea to make it easy and fast for any company to manage its overall digital presence. The solution includes apps that provide real-time diagnosis, direct management and automatic updates of public info on directories.</p>
<a class="mono" href="#">&lt; keep reading /&gt;</a>
@nanlabsweb
nanlabsweb / init.sh
Last active August 18, 2016 10:45
POST - Docker init script.
#!/bin/bash
# we can add any command to be executed whe the container is run
tail -f /dev/null
@nanlabsweb
nanlabsweb / Dockerfile
Last active August 18, 2016 10:45
POST - Dockerfile sample for post.
FROM ubuntu
MAINTAINER NaN Labs
# install default aptitude apache2
# try to use the less amount of RUN executions
# to reduce the image binary file
RUN apt-get update && apt-get install -y apache2
# environment variable deployKey will be available
@nanlabsweb
nanlabsweb / post-docker-bonus.sh
Created August 18, 2016 10:46
POST - Docker useful commands.
# remove all containers
sudo docker rm $(sudo docker ps -a -q)
# view last container
sudo docker ps -l
# remove all non-running containers
sudo docker ps -a | grep Exited | awk '{ print $NF }' | xargs sudo docker rm
# remove image containing TERM
@nanlabsweb
nanlabsweb / post-profile-module.js
Created August 18, 2016 11:15
POST - Angular profile module.
angular.module('profile', ['ngRoute']).config(function($stateProvider) {
return $stateProvider.state('my', {
url: '/my',
templateUrl: 'my-view.html',
abstract: true
});
});
@nanlabsweb
nanlabsweb / post-my-view.html
Created August 18, 2016 11:16
POST - Angular view example.
<ng-include src="'header-view.html'"></ng-include>
<ng-include src="'top-profile-navigation.html'"></ng-include>
<div class="row">
<div ui-view="aside-navigation"></div>
<div ui-view="content"></div>
</div>
<ng-include src="'footer-view.html'"></ng-include>
@nanlabsweb
nanlabsweb / post-my-messages-state.js
Created August 18, 2016 11:18
POST - Angular state example.
angular.module('profile').config(function($stateProvider) {
return $stateProvider.state('my.messages', {
url: '/messages',
views: {
'aside-navigation': {
templateUrl: 'aside-messages.html',
controller: 'AsideMessagesController'
},
'content': {
template: '<div ui-view="content"></div>'
@nanlabsweb
nanlabsweb / post-my-messages-child-states.js
Created August 18, 2016 11:19
POST - Angular child states example.
angular.module('profile').config(function($stateProvider) {
return $stateProvider.state('my.messages.new', {
url: '/new',
views: {
'content': {
templateUrl: 'new-message.html',
controller: 'NewMessageController'
}
}
}).state('my.messages.inbox', {
@nanlabsweb
nanlabsweb / post-logrotate
Last active August 18, 2016 11:37
POST - Logrotate example.
/var/log/example/*.log {
su example adm
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 644 example adm
postrotate
@nanlabsweb
nanlabsweb / post-create-deb-package.sh
Created August 18, 2016 11:38
POST - Create deb package example.
#!/bin/bash
APP_NAME=example-app
PACKAGE_NAME=${APP_NAME}_1.0-0 #Standard Debian notation <project>_<major version>.<minor version>-<package revision>
mkdir -p $PACKAGE_NAME/DEBIAN #Copy control, postinst, preinst scripts here
mkdir -p $PACKAGE_NAME/etc/$APP_NAME #Copy conf.json file here
mkdir -p $PACKAGE_NAME/etc/init/ #Copy ${APP_NAME}.conf upstart script here
mkdir -p $PACKAGE_NAME/etc/logrotate.d/ #Copy $APP_NAME logrotate script here
mkdir -p $PACKAGE_NAME/var/lib/$APP_NAME #Copy application src here
mkdir -p $PACKAGE_NAME/var/log/$APP_NAME #keep empty