Skip to content

Instantly share code, notes, and snippets.

View faloi's full-sized avatar

Federico Aloi faloi

  • Argentina
View GitHub Profile
@faloi
faloi / Perro.groovy
Created August 15, 2013 05:26
Ejemplo del uso de properties en groovy
class Perro {
def nombre
def edad
def getSaludo() {
"Hola soy ${nombre}!"
}
def setEdad(nuevaEdad) {
if (nuevaEdad > 100)
# Configure terminator to run as default terminal (e.g. CTRL + ALT + T)
gconftool --type string --set /desktop/gnome/applications/terminal/exec terminator
# Configure terminator to launch when "Open in terminal" is clicked using Nautilus
gsettings set org.gnome.desktop.default-applications.terminal exec-arg "-x"
gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/terminator
# Script based on http://newtriks.com/2013/06/11/automating-angularjs-with-yeoman-grunt-and-bower/
# Install dependencies (Yeoman, Grunt, Bower). See http://yeoman.io/
sudo npm install -g yo grunt-cli bower karma generator-angular
# Create project structure using yo
mkdir angularjs-grunt-example && cd $_
yo angular
# Install nodejs dependencies
class Api
doRequest: (options) =>
$.ajax(options).fail @showNotification
showNotification: (jqXHR) =>
message = "#{ jqXHR.statusText }."
window.currentBoard().showNotification
template: message
container: ''
clazz: 'danger'
def clientes = clientes.findAll { unCliente -> unCliente.getNombre().contains(clienteElegido) }
def entradasDelCliente = []
for(cliente in clientes){
for (entrada in cliente.entradas){
entradasDelCliente.addAll(entrada)
}
}
entradasDelCliente
@faloi
faloi / .zshrc
Last active March 22, 2018 21:39
My zsh configuration
ANTIGEN=$HOME/bin
# Example aliases
alias zshconfig="st ~/.zshrc"
alias gitconfig="st ~/.gitconfig"
alias delete_merged_branches="git branch --merged | grep -v '\*' | xargs -n 1 git branch -d"
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
alias install='sudo apt-get install'
/* Drop all non-system stored procs */
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']'
EXEC (@SQL)
template<class TYPE>
NodoListaSE <TYPE> * NodoListaSE <TYPE>::Pop ()
{
NodoListaSE <TYPE> *ultimo = this->ObtenerUltimo();
NodoListaSE <TYPE> *anteultimo = this->BuscarNodoAnteriorA(ultimo);
anteultimo.sgte = 0;
return ultimo;
}
procedure Linea(largo, direccion, color) {
repeatWith i in 1..largo {
Poner(color)
Mover(direccion)
}
}
procedure Cuadrado(largo, color) {
repeatWith dir in Norte..Oeste {
Linea(largo, dir, color)
@faloi
faloi / toggle_azure_website_profiling.ps1
Created June 2, 2014 22:41
A workaround to force New Relic to release the DLL on an Azure Website
# AUTHOR:
# @faloi - Federico Aloi
# PURPOSE:
# A workaround to force New Relic to release the DLL on an Azure Website, accomplished by toggling profiling on/off.
# This script must be run before and after the actual deploy, assuming that profiling is enabled at the beginning.
# PRECONDITIONS:
# $azureWebsiteName is an existing Website of the current subscription
# COR_ENABLE_PROFILING is an existent app setting