Skip to content

Instantly share code, notes, and snippets.

View mbaez's full-sized avatar

Maximiliano Báez González mbaez

  • @willdompy
  • Asunción, Paraguay
View GitHub Profile
@mbaez
mbaez / angular-analytics.js
Created February 22, 2017 15:40
Integración de un SPA (angular) con google analytics.
/**
* Definición del módulo
*/
var app = angular.module("demoApp",[/*Dependencias*/]);
/**
* Configuracin de las rutas.
*/
app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider
<VirtualHost *:80>
ServerName balanceador
# Actuamos como reverse proxy, apareciendo a los clientes
# como un servidor web corriente.
ProxyRequests Off
# Acceso sin restringir.
<Proxy *>
Order deny,allow
Allow from all
@mbaez
mbaez / Cliente.java
Last active March 7, 2016 12:55
Programación Web - Dynamic Proxy
/**
* Facultad Politécnica - Ingeniería en Informática.
* Programación Web - Dynamic Proxy
*
* Ejercicio de como utilizar Dynamic Proxy
*
* @author mbaez
*/
public class Cliente {
@mbaez
mbaez / get-and-set-attribute.html
Last active August 29, 2015 13:59
Set and get data using html data-attributes
<header>
<label> Hi <span data-attr="fullname">?</span>!
</header>
<form id="from-data">
<fieldset>
<label class="control-label" for="input-username">Username</label>
<input data-attr="username" type="text" id="input-username" >
<label class="control-label" for="input-name">full name</label>
@mbaez
mbaez / change-brightness.sh
Created February 28, 2014 13:32
This script change the brightness for intel backlight driver, works in sony vaio
#!/bin/sh
# sudo ./change-brightness.sh -3000 //reduce the brightness
# sudo ./change-brightness.sh 3000 //add brightness
path=/sys/class/backlight/intel_backlight
echo `cat $path/actual_brightness`+ $1 | bc > $path/brightness
@mbaez
mbaez / get-url-params.js
Created February 26, 2014 14:37
This method gets the url parameters and constructs an object with them
/**
* This method gets the url parameters and constructs an object with them.
* <code>
* localhost/app?param=1&param2=2&params3=text
*
* getUrlParams() returns {param: 1, param2:2, params3='text'}
* </code>
* @author Maximiliano Báez
*/
function getUrlParams() {
@mbaez
mbaez / gmail-pop3-refresh.js
Last active March 7, 2021 18:05
This script, force one click, every 10 seconds in Gmail Refresh Pop Account button
/**
* This script, force one click, every 10 seconds in Gmail Refresh Pop Account button
* @author Maximiliano Báez
*/
var $popup = window.open("https://mail.google.com/mail/ca/u/0/?shva=1#settings/accounts",'_blank', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10000, top=10000, width=10, height=10, visible=none');function refreshPop(){var $el = $popup.document.getElementsByClassName("rP sA"); if($el.length>0){$el = $el[0]; $el.click(); console.log($el)} setTimeout(refreshPop, 10000)};refreshPop();