Skip to content

Instantly share code, notes, and snippets.

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

Jairo Fernández jairoFernandez

🙃
creating....
View GitHub Profile
@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>
@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 / 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 / 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 / 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 / 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)

Dockerfile

FROM node:6.9
MAINTAINER [email protected]
LABEL authors="Jairo Fdez <[email protected]>"

## 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 / DeleteFolder.php
Created July 12, 2017 16:56
Delete a folder with PHP
public function removeDirectory($path) {
if(is_dir($path)){
$files = glob($path . '/*');
foreach ($files as $file) {
is_dir($file) ? $this->removeDirectory($file) : unlink($file);
}
rmdir($path);
}
return;
@jairoFernandez
jairoFernandez / ObtainVersionGit.php
Created July 12, 2017 16:55
Obtain_last_version_git_PHP
public function ObtainLastVersionCode($directoryCode)
{
try{
$dir = $directoryCode;
chdir($dir);
$version = 'git rev-parse --verify HEAD';
$comment = 'git log -1 --pretty=%B';
$date = 'git log -1 --format=%cd --date=local';
$outputVersion = shell_exec($version);
$outputComment = shell_exec($comment);
#include <Servo.h>
Servo servo_1;
Servo servo_2;
Servo servo_3;
Servo servo_4;
Servo servo_5;
int flex_1 = 0;
int flex_2 = 1;