This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TabFile < File | |
def initialize(file, regexp) | |
super(file, "r") | |
@regexp = regexp | |
end | |
def tab_data | |
data = Array.new | |
self.each { |line| | |
line_match = @regexp.match(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . | while read file | |
do | |
echo "Processing $file file..." | |
avconv -i "$file" -s qvga -strict experimental "$file".mp4 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() { | |
// Cargar el objeto Json remotamente | |
var xhr = createXHR(); | |
xhr.onreadystatechange = function(){ | |
if (xhr.readyState == 4){ | |
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304){ | |
alert(xhr.responseText); | |
} else { | |
alert(“Request was unsuccessful: “ + xhr.status); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FUNCION PARA CREAR UN ARRAY DE OBJETOS A PARTIR DEL ARRAY DE VALORES | |
function creaMapa(mapa) { | |
var fila; | |
var columna; | |
var mapaObjetos = []; // mapa de objetos | |
for (fila = 0; fila < mapa.length; fila++) { | |
mapaObjetos[fila] = []; | |
for (columna = 0; columna < mapa[fila].length; columna++) { | |
mapaObjetos[fila][columna] = creaCelda(fila, columna, mapa[fila][columna]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.extend({ | |
enable: function (func) { | |
if (func == undefined) { | |
$(this).css("opacity", "1"); | |
} else { | |
func(); | |
} | |
restoreEvents($(this)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var teclas = { 32: false, 33: false, 34: false }; | |
document.addEventListener("keydown", function(event) { | |
teclas[event.keyCode] = true; | |
}); | |
document.addEventListener("keyup", function(event){ | |
teclas[event.keyCode] = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRedditUserData(usuario) { | |
var url="http://www.reddit.com/user/" + usuario + "/about.json"; | |
Logger.log("URL:" +url); | |
var response = UrlFetchApp.fetch(url); | |
Logger.log("RESPONSE:" + response); | |
return response.getContentText(); | |
} | |
function getCommentKarma(data) { | |
var json = JSON.parse(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MICROSOFT DREAMSPARK DIRECT | |
CONTRATO DE SUSCRIPCIÓN | |
Última actualización: Junio de 2013 | |
Este es un contrato de suscripción (“contrato”) entre Microsoft Corporation (o, según donde resida, una de sus filiales) y usted, para la oferta para estudiantes de Microsoft DreamSpark Direct (“Suscripción a DreamSpark Direct”). Le rogamos que lo lea atentamente. Para fines de este contrato, el término “software” se aplica al software que se le proporcionó en virtud de la Suscripción a DreamSpark Direct, lo que incluye los soportes físicos en que lo recibió, si los hubiera. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static JSONObject requestWebService(String serviceUrl) { | |
disableConnectionReuseIfNecessary(); | |
HttpURLConnection urlConnection = null; | |
try { | |
// create connection | |
URL urlToRequest = new URL(serviceUrl); | |
urlConnection = (HttpURLConnection) | |
urlToRequest.openConnection(); | |
urlConnection.setConnectTimeout(CONNECTION_TIMEOUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsdom = require("jsdom-global")(); | |
const $ = require("jquery"); | |
// modify HTML | |
document.body.innerHTML = "<!DOCTYPE html><form id=\"form1\"><textarea id=\"tb1\">Hello world</textarea></form>"; | |
function keyPressed(e) { | |
console.log("keypressed"); | |
} |