Skip to content

Instantly share code, notes, and snippets.

Josue Zarzosa josketres

Block or report user

Report or block josketres

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josketres
josketres / GLPK+JAVA+Windows example
Created Sep 29, 2013
GLPK+JAVA+Windows example
View GLPK+JAVA+Windows example
import org.gnu.glpk.GLPK;
import org.gnu.glpk.GLPKConstants;
import org.gnu.glpk.GlpkException;
import org.gnu.glpk.SWIGTYPE_p_double;
import org.gnu.glpk.SWIGTYPE_p_int;
import org.gnu.glpk.glp_prob;
import org.gnu.glpk.glp_smcp;
public class Main {
// Minimize z = (x1-x2) /2 + (1-(x1-x2)) = -.5 * x1 + .5 * x2 + 1
@josketres
josketres / Instrucciones.md
Last active Apr 11, 2016
unit-testing-exercise-java
View Instrucciones.md

#Ejercicio didáctico de pruebas unitarias de software# El programa acepta como entrada una cadena de caracteres, la salida es una lista de los caracteres que esten rodeados por guiones "-".

Por ejemplo: Entrada: aaa-bb-ccc Salida: [bb]

##Restricción arbitraria## Se restringe el uso de expresiones regulares. El programa Main.java debe de ser modificado de tal manera que no se haga uso de la clase java.util.regex.Pattern.

View gist:6934592
console.log('hello example');
ddd
@josketres
josketres / eclipse-favorite-types-java-tdd
Last active Jan 3, 2016
Useful favorite types to add to eclipse IDE for Java development (TDD)
View eclipse-favorite-types-java-tdd
# Useful favorite types to add to eclipse IDE for Java development (TDD)
# Add them in Eclipse under:
# Window -> Preferences -> Java -> Editor -> Content Assist -> Favorites -> New Type
org.hamcrest.MatcherAssert
org.hamcrest.Matchers
org.junit.Assert
org.testng.AssertJUnit
org.mockito.Mockito
org.mockito.MockitoAnnotations
View .tmux.conf
# use vi mode
setw -g mode-keys vi
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
@josketres
josketres / ejemplo-captura-de-errores-globales.js
Last active Aug 29, 2015
Captura global de errores en javascript (ejemplo)
View ejemplo-captura-de-errores-globales.js
(function() {
var errorCount = 0;
window.onerror = function(error, location, line) {
if (errorCount < 5) {
sendErrorReport(error + ' [' + location + ':' + line + ']');
errorCount++;
}
return false;
};
})();
@josketres
josketres / ejemplo-envio-reporte-de-error.js
Last active Aug 29, 2015
Envio de un reporte de error mediante una petcion HTTP POST de manera "cross-browser" y sin depender de librerías externas.
View ejemplo-envio-reporte-de-error.js
var sendErrorReport = function(error) {
var xhr = createXMLHTTPObject();
xhr.open('POST', endpointUrl, true);
xhr.send(error);
};
var createXMLHTTPObject = function() {
var xmlhttp, XMLHttpFactories = [
function() {
return new XMLHttpRequest();
@josketres
josketres / ejemplo-reporte-de-errores-con-stacktrace.js
Created Feb 23, 2014
Ejemplo de reporte de errores utilizando stacktrace.js
View ejemplo-reporte-de-errores-con-stacktrace.js
function buyItem(itemId) {
if(!isValidItemId(itemId)) {
var errorReport = printStackTrace().join('\n');
sendErrorReport(errorReport);
return;
}
try {
doBuyTheItem(itemId);
@josketres
josketres / java-type-filters-list.txt
Last active Aug 29, 2015
My Java Type Filters for eclipse
View java-type-filters-list.txt
Window -> Preferences -> Java -> Appearance -> Type Filters
com.beust.jcommander.internal*
org.testng.collections.*
org.testng.internal.*
@josketres
josketres / toggle-monitors.sh
Last active Aug 29, 2015
toggle your monitors setup between 'extended' and 'mirror' (ideal for pair programming)
View toggle-monitors.sh
#!/bin/bash
# https://gist.github.com/josketres/ff195f4f1d64e7593f04#file-toggle-monitors-sh
# toggle your monitors setup between 'extended' and 'mirror'
# ideal for pair programming sessions
number_of_monitors=`xrandr | grep " connected" | cut -d " " -f 1 | wc -l`
if [ "$number_of_monitors" != "2" ]
then
echo "You should have 2 monitors connected to use this script"
exit 1
You can’t perform that action at this time.