Skip to content

Instantly share code, notes, and snippets.

View valterlobo's full-sized avatar

Valter Lobo valterlobo

View GitHub Profile
@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@izazueta
izazueta / visor-archivos-online.md
Last active September 26, 2024 01:27
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@yanaga
yanaga / gist:3024877
Created June 30, 2012 18:04
Código Java para validação do CNS (Cartão Nacional de Saúde)
public boolean isValid(String s) {
if (s.matches("[1-2]\\d{10}00[0-1]\\d") || s.matches("[7-9]\\d{14}")) {
return somaPonderada(s) % 11 == 0;
}
return false;
}
private int somaPonderada(String s) {
char[] cs = s.toCharArray();
int soma = 0;