Skip to content

Instantly share code, notes, and snippets.

View alphamikevictor's full-sized avatar

alphamikevictor

View GitHub Profile
@alphamikevictor
alphamikevictor / python_turtle_draw_polygons.py
Created April 7, 2018 05:16
Python draw polygons using turtle
import turtle
def polygon(vertices,pixels=50,clockwise=True):
tt = (turtle.left,turtle.right)[clockwise]
if not isinstance(vertices,int):
raise TypeError("I need an Integer for vertices")
if vertices < 3:
raise ValueError("Vertices al menos ha de valer 3")
if not isinstance(pixels,int):
raise TypeError("I need pixels as integer")
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13 r1665067">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
@alphamikevictor
alphamikevictor / JaxRSActivator.java
Last active August 29, 2015 14:16
REST + EJB example
package com.alosfogones.REST;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("/rest")
public class JaxRSActivator extends Application {
}
@alphamikevictor
alphamikevictor / ReadProperties.java
Created February 12, 2015 15:36
Jboss remoting cluster
package com.alosfogones.rest;
import java.util.Hashtable;
import javax.enterprise.context.RequestScoped;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@alphamikevictor
alphamikevictor / Guitarra.java
Created January 13, 2015 13:04
Ejemplo tonto de polimorfismo en Java
package com.alosfogones.instrument;
public class Guitarra implements Instrument {
@Override
public void toca() {
System.out.println("Soy una guitarra");
}
@alphamikevictor
alphamikevictor / index.html
Last active April 10, 2016 15:47
AngularJS custom form validator for ip address and netmask plus animations
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-animate.min.js"></script>
<link rel="stylesheet" href="http://daneden.github.io/animate.css/animate.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
</head>
<body ng-app="app">
<div class="container-fluid" ng-controller="testController">
<div class="container-fluid" ng-hide="showList" ng-class="{'animated fadeInDown': ! showList}">