Skip to content

Instantly share code, notes, and snippets.

@nicopaez
nicopaez / Algo3-TP0-2012-1-TemaA
Created March 12, 2012 04:52
Trabajo práctico N° 0, Tema A, Primer Cuatrimestre 2012, Algoritmos y Programación 3, FIUBA
|huevo mostaza hamburguesa|
huevo := Huevo new.
huevo calorias = 10 ifTrue: [ Transcript show: 'Prueba 1 OK'; cr.].
mostaza := Mostaza new.
mostaza calorias =30 ifTrue: [ Transcript show: 'Prueba 2 OK'; cr.].
hamburguesa := Hamburguesa new.
hamburguesa calorias =100 ifTrue: [ Transcript show: 'Prueba 3 OK'; cr.].
@nicopaez
nicopaez / Algo3-TP0-2012-1-TemaB
Created March 13, 2012 23:54
Trabajo práctico N° 0, Tema B, Primer Cuatrimestre 2012, Algoritmos y Programación 3, FIUBA
|libreta materia1 materia2|
materia1 := Materia new.
materia1 calificacion: 9.
(materia1 estaAprobada) ifTrue: [ Transcript show: 'Prueba 1 OK'; cr.].
materia2 := Materia new.
materia2 calificacion: 1.
(materia2 estaAprobada) ifFalse: [ Transcript show: 'Prueba 2 OK'; cr.].
libreta := LibretaUniversitaria new.
$req = [System.Net.HttpWebRequest]::Create("http://someplace");
$response = $null
$response = $req.GetResponse()
if ($response.StatusCode -eq "OK")
{
Write "Ok"
}
else
{
throw "Error"
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package="C:\sourcepackage.zip" -dest:auto,computerName=https://someserver:8172/msdeploy.axd?site=yoursite.com,userName=jenkins,password=somepassword,authType=basic -allowUntrusted=true -setParam:"IIS Web Application Name"="yoursite.com" -postSync=runCommand='msbuild C:\www\yoursite.com\deploy.xml /t:ConfigureApp',waitInterval=10000
@nicopaez
nicopaez / gist:7923259
Created December 12, 2013 04:39
Jenkins Jobs backup script
$items = get-childitem jobs
foreach ($item in $items)
{
mkdir -Force "jobs_backup/jobs_config/$item/"
cp "jobs/$item/config.xml" "jobs_backup/jobs_config/$item/"
}
cd jobs_backup
svn add * --force
svn commit -m "Automated Jobs Backup"
curl http://localhost:8080/jnlpJars/jenkins-cli.jar > jenkins-cli.jar
java -jar jenkins-cli.jar -s http://localhost:8080 install-plugin rbenv htmlpublisher copyartifact greenballs jabber build-pipeline-plugin simple-theme-plugin sidebar-link xvfb
{
"require-dev": {
"sebastian/phpcpd": "*",
"phploc/phploc": "*",
"phpmd/phpmd" : "1.4.*",
"mayflower/php-codebrowser": "~1.1"
}
}
@nicopaez
nicopaez / gist:8529178
Last active January 3, 2016 22:29
Dependency Management in .NET
$source = "http://nuget.org/nuget.exe"
$destination = "c:\BuildTools\NuGet.exe"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($source, $destination)
cd c:\BuildTools\
nuget restore -PackageDirectory .
<?xml version="1.0" encoding="utf-8"?>
<packages>
@nicopaez
nicopaez / Gemfile
Last active August 29, 2015 14:00
rspec & guard
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rspec'
gem 'guard'
gem 'guard-rspec'
@nicopaez
nicopaez / gist:60ebad4311d691e803d1
Last active August 29, 2015 14:01
Jenkins backup script
#!/bin/bash
set -e
cd /var/lib/jenkins/jobs
cp --parent ./*/config.xml /var/jenkins-backup/repo
cd /var/jenkins-backup/repo
git add .
git commit -m "Config files updated"
git push origin master