Skip to content

Instantly share code, notes, and snippets.

Avatar

victor sosa victorsosa

  • PeopleWare
  • Santo Domingo, Dom. Rep.
View GitHub Profile
@victorsosa
victorsosa / loopback-auto-update-structure.js
Created Jan 26, 2018 — forked from indrasantosa/loopback-auto-update-structure.js
Loopback boot scripts to update the table based on json model definition, the name of the table should be speci
View loopback-auto-update-structure.js
var glob = require('glob');
var path = require('path');
module.exports = function(app) {
var ds = app.dataSources['automailer-db']
var files = glob.sync(path.join(__dirname, '..', '..', '/common/models/*.json'))
files.forEach(function(file) {
var modelDefinition = require(file)
View sniproxy.conf
user sniproxy
pidfile /var/run/sniproxy.pid
listener 209.208.27.224 80 {
proto http
table proxies
}
listener 209.208.27.224 443 {
View servicemix docker
FROM java:openjdk-8
MAINTAINER mkroli
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV SERVICEMIX_VERSION_MAJOR=7
ENV SERVICEMIX_VERSION_MINOR=0
ENV SERVICEMIX_VERSION_PATCH=1
ENV SERVICEMIX_VERSION=${SERVICEMIX_VERSION_MAJOR}.${SERVICEMIX_VERSION_MINOR}.${SERVICEMIX_VERSION_PATCH}
RUN wget http://www-us.apache.org/dist/servicemix/servicemix-${SERVICEMIX_VERSION_MAJOR}/${SERVICEMIX_VERSION}/apache-servicemix-${SERVICEMIX_VERSION}.zip; \
@victorsosa
victorsosa / .autotest
Created Aug 6, 2016 — forked from nijitaro/.autotest
Rails 3 + rspec2 + mongoid + Factory_girl + autotest(growl)
View .autotest
# Include plugins
require 'autotest/fsevent'
require 'autotest/growl'
# Skip some paths
Autotest.add_hook :initialize do |autotest|
%w{.git .DS_Store ._* vendor}.each { |exception| autotest.add_exception(exception) }
false
end
@victorsosa
victorsosa / gist:2bd6eec1cc4c82b1bbb3c28dc058e1d1
Created Jun 30, 2016 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
View gist:2bd6eec1cc4c82b1bbb3c28dc058e1d1
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@victorsosa
victorsosa / _.md
Created Jun 9, 2016 — forked from marcoslin/_.md
ui-router: Lazy Loading State
View _.md

Lazy Load States

Sample code for on how to lazy load state for ui-router

@victorsosa
victorsosa / Dockerfile
Created Apr 22, 2016
Docker fedora 23 nginx passenger
View Dockerfile
FROM fedora:23
ENV RACK_ENV=production RAILS_ENV=production
ENV APP_HOME /home/app/logica-erp
ENV SECRET_KEY_BASE_KDS=ddb70f72d4e61d32e30c941748f50d6e4e338adc05662235d5003a41218154141c081c548aa7a101c157825c6ac1250cf60504c7993e96045b7d33bc483c2dd8
RUN dnf update -y
RUN dnf install https://downloads.ulyaoth.net/rpm/ulyaoth-1.1.0-1.fedora.noarch.rpm -y
RUN dnf install -y ulyaoth-nginx-passenger5 ulyaoth-nginx-passenger5-selinux
RUN dnf install -y git make curl-devel openssl-devel ruby-devel rubygem-bundler libxslt-devel libxml2-devel java-devel patch gcc-c++ redhat-rpm-config
View nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
@victorsosa
victorsosa / gist:c6a2c77b4a74e431ab8b62d573ce931e
Created Apr 13, 2016 — forked from yograterol/gist:99c8e123afecc828cb8c
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" workaround
View gist:c6a2c77b4a74e431ab8b62d573ce931e
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" CentOS's and Fedora +22 workaround
Install `redhat-rpm-config`
$ sudo dnf install redhat-rpm-config
@victorsosa
victorsosa / fedora-install-nodejs.sh
Last active May 13, 2019 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v5.7.0)
View fedora-install-nodejs.sh
#!/usr/bin/env bash
func_check_for_root() {
if [ ! $( id -u ) -eq 0 ]; then
echo "ERROR: $0 Must be run as root, Script terminating" ;exit 7
fi
}
func_check_for_root
#SETUP PARAMS