Skip to content

Instantly share code, notes, and snippets.

View geryxyz's full-sized avatar

Gergő Balogh geryxyz

View GitHub Profile
public
event EventHandler< EventArgs< DAGEntity > > Visiting;
public
void Visit(Action<List<DAGEntity>,DAGEntity > incrementor)
{
List< DAGEntity > _entitiesToVisit = new List< DAGEntity >( Roots );
while ( _entitiesToVisit.Any( ) )
{
DAGEntity _current = _entitiesToVisit.First( );
public
Point3D Offset { get; set; }
public
Point3D AccumulatedOffset
{
get
{
if(StructuralParent!=null)
{
public static
TOut Form<TIn,TOut>(this TIn self, Format<TIn,TOut> format)
{
return format.Apply( self );
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using CodeMetropolis.Model.Sub.Layout;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
<UserControl
x:Class = "MaPpEd.View.Sub.Grabable"
xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d = "http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable = "d"
d:DesignHeight = "300"
d:DesignWidth = "300" >
<Grid>
@geryxyz
geryxyz / gist:735b8ac860c596269286
Last active August 29, 2015 14:07
connect two control in wpf
<Line
X1 = "{Binding ElementName=one, Path=(Canvas.Left)}"
Y1="{Binding ElementName=one, Path=(Canvas.Top)}"
X2="{Binding ElementName=two, Path=(Canvas.Left)}"
Y2="{Binding ElementName=two, Path=(Canvas.Top)}"
Stroke="Black">
</Line>
@geryxyz
geryxyz / example.cs
Created November 21, 2014 10:25
C# (.Net) 4.5 inheritance and protected with references
namespace TestEditor
{
public
class Parent
{
public
string macska { get; protected set; }
protected
string kutya { get; set; }
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, 4, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(6, INPUT);
pixel.begin();
pixel.setPixelColor(0, 0, 0, 0);
pixel.show();
Serial.begin(9600);
@geryxyz
geryxyz / neither.py
Last active March 14, 2018 16:44
Niether operator for Python 3.6
def neither(subject, *objects, compare=lambda s,o: s == o):
for object in objects:
if compare(subject,object):
return False
return True
@geryxyz
geryxyz / algoritmikus nyulak.py
Last active June 11, 2019 10:28
A simple algorithm to calculate an aesthetically pleasing order of bunny shaped door ornaments.
"""
A simple algorithm to calculate
an aesthetically pleasing order of
bunny shaped door ornaments.
"""
colors = ['green', 'pink', 'blue', 'yellow']
for i in range(5):
for index, current in enumerate(colors):
print(current, end=' ')