Skip to content

Instantly share code, notes, and snippets.

View jairoFernandez's full-sized avatar
🙃
creating....

Jairo Fernández jairoFernandez

🙃
creating....
View GitHub Profile

Dockerfile

FROM node:6.9
MAINTAINER jairofdezvega@gmail.com
LABEL authors="Jairo Fdez <jairofdezvega@gmail.com>"

## prepare a user which runs everything locally! - required in child images!
RUN useradd --user-group --create-home --shell /bin/false app

ENV HOME=/usr/src/app
@jairoFernandez
jairoFernandez / clean_docker.sh
Created July 30, 2017 03:47 — forked from urodoz/clean_docker.sh
Cleans the old images and exited containers
# Clean the exited containers
docker rm $(sudo docker ps -a | grep Exit | cut -d ' ' -f 1)
# Clean the untagged images (or old images)
docker rmi $(docker images | tail -n +2 | awk '$1 == "<none>" {print $'3'}')
# On Docker 1.9+ you can remove the orphan volumes with the next command
docker volume rm $(docker volume ls -qf dangling=true)
@jairoFernandez
jairoFernandez / EjecutarMigracionDiferenteContexto.shell
Last active August 16, 2017 17:59
Ejecutar migración en diferentes contextos
## -ConfigurationTypeName: Nombre con el namespace de la configuración
Add-Migration MYMIGRATION -ConfigurationTypeName CORE.PrincipalMigrations.Configuration
Update-Database -ConfigurationTypeName CORE_API.PrincipalMigrations.Configuration
@jairoFernandez
jairoFernandez / function.js
Last active August 30, 2017 03:55
Console.log
(function () {
if (!console) {
console = {};
}
var old = console.log;
var logger = document.getElementById('log');
console.log = function (message) {
if (typeof message == 'object') {
logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />';
} else {
@jairoFernandez
jairoFernandez / tslint.json
Created August 30, 2017 20:01
Rules for angular tslint
# tslint.json
{
"extends": "tslint:latest",
"rules": {
"directive-selector-prefix": [false, "sg"],
"component-selector-prefix": [false, "sg"],
"pipe-naming": [false, "camelCase", "sg"],
"directive-selector-name": [true, "camelCase"],
"component-selector-name": [true, "kebab-case"],
"directive-selector-type": [true, "attribute"],
@jairoFernandez
jairoFernandez / Invoke.ps
Created September 19, 2017 20:22
Invoke rest method Powershell
EXEC sys.xp_cmdshell '%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Invoke-RestMethod -Uri http://google.com -Method Get'
@jairoFernandez
jairoFernandez / MiProyecto.csproj
Last active October 9, 2017 22:21
Download nugets in TFS 2012
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
....
<PropertyGroup>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<Import Project="$(MSBuildProjectDirectory)\..\.nuget\NuGet.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
var Sinco = function(){};
function ObserverList(){
this.observerList = [];
}
ObserverList.prototype.add = function(obj){
return this.observerList.push(obj);
};
@jairoFernandez
jairoFernandez / Directory_dinamically.sh
Created October 19, 2017 19:43
Create directory dinamically in linux
touch F{1..9} "Crea los ficheros desde el 1 hasta el 9"
Ejemplo: F1 F2 F3 F4 F5 F6 F7 F8 F9
touch F{1..100} "Crea los ficheros desde el 1 hasta el 100"
Ejemplo: F1 F2 F3 F4 F5 F6 F7 F8 F9...F100
touch F{a..z} "Crea los ficheros desde la a hasta la z"
Ejemplo: Fa Fb Fc Fe...Fz
mkdir D{1..9} "Crea los directorios desde el 1 hasta el 9"
Ejemplo: D1 D2 D3 D4 D5 D6 D7 D8 D9
mkdir D{1..100} "Crea los directorios desde el 1 hasta el 100"
@jairoFernandez
jairoFernandez / Task.js
Created October 23, 2017 22:41
MediatorPattern
var Task = function(data){
this.name = data.name;
this.completed = false;
}
Task.prototype.complete = function(){
console.log('Completed task: ' + this.name);
this.completed = true;
}