Skip to content

Instantly share code, notes, and snippets.

View dariodiaz's full-sized avatar

Dario Diaz dariodiaz

View GitHub Profile
@dariodiaz
dariodiaz / javascript_countdown.js
Created August 27, 2012 11:17
javascript: countdown
var javascript_countdown = function () {
var time_left = 10; //number of seconds for countdown
var output_element_id = 'javascript_countdown_time';
var keep_counting = 1;
var no_time_left_message = 'No time left for JavaScript countdown!';
function countdown() {
if(time_left < 2) {
keep_counting = 0;
}
@dariodiaz
dariodiaz / links.md
Created August 28, 2012 23:15 — forked from igrigorik/links.md
performance: HAR Show links & resources
@dariodiaz
dariodiaz / FeatureContext.php
Created August 29, 2012 16:21 — forked from weaverryan/FeatureContext.php
behat: Behat Definition to help click generic links on different rows of a table
<?php
// ...
class FeatureContext extends MinkContext
{
/**
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
*
@dariodiaz
dariodiaz / backup
Created August 29, 2012 18:34 — forked from sposmen/rsync-ssh.md
ssh: Rsync con ssh, o sea para que no pida contraseñas, es decir,con certificados
Realizar backups de manera facil con rsync y ssh
Enviado por RazaMetaL el Mié, 2007-02-14 14:27.
Tengo dos servidores, uno tiene un eggdrop que guarda el log de actividad de un canal en /home/bot/logs/canal. Hasta ahi todo esta muy bien, pero requiero que esos logs se publiquen en un sitio web que se encuentra en otro servidor.
La manera mas sencilla y practica que encontre para hacer esta tarea fue usando rsync para sincronizar los archivos de log desde un servidor a otro y que solo se copien los archivos nuevos o modificados.
Primero vamos a decidir las opciones para rsync, en mi caso y como lo explico en el parrafo anterior requiero copiar todos los archivos al nuevo servidor, despues que copie solo los nuevos archivos y/o los modificados. Todo esto lo logro pasando las opciones -avz y -e ssh a rsync.
-a para copiar recursivamente manteniendo privilegios, fecha de creacion, permisos, etc.;
@dariodiaz
dariodiaz / TestingUploadSe2Sauce.java
Created October 11, 2012 02:20 — forked from santiycr/TestingUploadSe2Sauce.java
webdriver: Remote File Upload using Selenium 2's FileDetectors
import junit.framework.Assert;
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class TestingUploadSe2Sauce extends TestCase {
private RemoteWebDriver driver;
@dariodiaz
dariodiaz / puppet_deploy.sh
Created October 17, 2012 18:47 — forked from mitchellh/gist:3792312
bash: puppet deploy
#!/bin/bash
#
# This is the script responsible for updating our Puppet master data,
# which includes modules, manifests, hiera data, etc. All of this data is
# managed in a git repository and upon "deploy" it is synced into the Puppet
# master.
#
# This script mirrors the remote git repository, looking for branches that
# match "env-*" (such as "env-production" or "env-test"). Each of these branches
# is setup as an environment into the Puppet master's data files. The
@dariodiaz
dariodiaz / Frontend Tools
Created November 20, 2012 15:40
javascript, html, css: List of Frontend Tools
#Landscaping With Frontend Development Tools
An opinionated list of tools for frontend (i.e. html, js, css) desktop/laptop (i.e. does not include tablet or phone yet) web development
##Coding Tools
######Workflow/Builds/Assemblers
@dariodiaz
dariodiaz / README.md
Created November 22, 2012 22:47 — forked from oodavid/README.md
php,git: Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@dariodiaz
dariodiaz / SessionStorage.java
Created January 31, 2013 23:50 — forked from roydekleijn/SessionStorage.java
java:Session Storage
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class SessionStorage {
private JavascriptExecutor js;
public SessionStorage(WebDriver driver) {
this.js = (JavascriptExecutor) driver;
}
@dariodiaz
dariodiaz / LocalStorage.java
Created March 4, 2013 03:28 — forked from roydekleijn/LocalStorage.java
Java: WebDriver and LocalStorage
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
public class LocalStorage {
private JavascriptExecutor js;
public LocalStorage(WebDriver webDriver) {
this.js = (JavascriptExecutor) webDriver;
}