Skip to content

Instantly share code, notes, and snippets.

View tecnocrata's full-sized avatar
:octocat:
Working from home

Enrique Ortuño tecnocrata

:octocat:
Working from home
View GitHub Profile
@tecnocrata
tecnocrata / gist:3948690
Created October 24, 2012 20:33
Creating a Circle by Code
private void CreateSymbolO(Grid board)
{
var O = new Ellipse();
O.Width = 70;
O.Height = 70;
O.Fill = new SolidColorBrush(new Color() { A = 255, R = 0, G = 255, B = 4 });
Grid.SetRow(O, 0);
Grid.SetColumn(O, 1);
board.Children.Add(O);
}
@tecnocrata
tecnocrata / gist:3948699
Created October 24, 2012 20:34
Creating a cross on a grid
private void CreateSymbolX(Grid board)
{
var geometry = new PathGeometry { Figures = new PathFigureCollection() };
var line1 = new PathFigure
{
Segments = new PathSegmentCollection { new LineSegment { Point = new Point(25, 25) } },
StartPoint = new Point(0, 0)
};
var line2 = new PathFigure
{
@tecnocrata
tecnocrata / gist:3955700
Created October 25, 2012 21:57
Un invocador de eventos Thread'Safe
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler tempEvent = PropertyChanged;
if (tempEvent != null)
{
tempEvent(this, new PropertyChangedEventArgs(propertyName));
}
}
@tecnocrata
tecnocrata / gist:4004112
Created November 2, 2012 20:25
Animacion simple basada en CSS
.tile-wrapper {
position : relative;
display : inline-block;
}
.tile-wrapper .image-options {
position : absolute;
top : 0;
right : 0;
left : 0;
height : 25px;
@tecnocrata
tecnocrata / gist:4004114
Created November 2, 2012 20:26
Animacion fade basada en CSS
.tile-wrapper {
position : relative;
display : inline-block;
}
.tile-wrapper img {
position : relative;
}
.tile-wrapper .image-options {
position : absolute;
top : 0;
@tecnocrata
tecnocrata / gist:4004755
Created November 2, 2012 22:30
El efecto de Normal/Hover/Pressed en un Tile/Boton usando CSS
.tile-wrapper a
{
border: 0px solid red;
margin: 0px;
width: 128px;
height:128px;
display:block;
}
.tile-wrapper a:hover
@tecnocrata
tecnocrata / gist:4061445
Created November 12, 2012 19:41
Testing Static Methods with Multi-Thread behaviour
public class StaticSpeedDecrease
{
static final int ITERATIONS = 100;
static final long MAX_VALUE = 100000;
public static void main(final String[] args)
{
int maxThreads = 100;
boolean isStatic = args.length > 0;
@tecnocrata
tecnocrata / gist:4075067
Created November 14, 2012 21:49
Cerrar conexiones a una Base de Datos y borrarla inmediatamente
alter database DBReport set single_user with rollback immediate
DROP Database DBReport
@tecnocrata
tecnocrata / gist:4133946
Created November 23, 2012 03:54
Web.config con elmah habilitado
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
@tecnocrata
tecnocrata / gist:4738932
Created February 8, 2013 13:03
Javascript Singleton with Self-writing Methods/Classes
/*var SocketRouter = function() {
console.log('Socket Router initialization');
SocketRouter = function() {
console.log('But I already did something!');
};
};
var x1 = new SocketRouter();