Skip to content

Instantly share code, notes, and snippets.

View victorsosa's full-sized avatar

victor sosa victorsosa

  • PeopleWare
  • Santo Domingo, Dom. Rep.
View GitHub Profile
@victorsosa
victorsosa / loopback-auto-update-structure.js
Created January 26, 2018 15:10 — 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
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)
@victorsosa
victorsosa / .autotest
Created August 6, 2016 17:02 — forked from nijitaro/.autotest
Rails 3 + rspec2 + mongoid + Factory_girl + autotest(growl)
# 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 June 30, 2016 16:23 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// 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 June 9, 2016 23:14 — forked from marcoslin/_.md
ui-router: Lazy Loading State

Lazy Load States

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

@victorsosa
victorsosa / gist:c6a2c77b4a74e431ab8b62d573ce931e
Created April 13, 2016 15:04 — forked from yograterol/gist:99c8e123afecc828cb8c
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" workaround
"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 11:22 — forked from trajakovic/fedora-install-nodejs.sh
Install node.js on fedora (23+).(v5.7.0)
#!/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