Skip to content

Instantly share code, notes, and snippets.

Tuxic Calebsem

View GitHub Profile
Calebsem /
Created Mar 18, 2016
Git LFS server config
# Provides: gitlfsserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
Calebsem / croppedImg.xaml
Last active Dec 7, 2015
Getting a useable cropped content with zero transform and correct size in UWP XAML
View croppedImg.xaml
Full is your viewmodel containing the whole of your content (whatever control, here as an example an image)
Part is your viewmodel containing the area to crop
Part has a clipping rect, and 2 offset (OffsetX and OffsetY) why are basicaly -Rect.X and -Rect.Y. This puts the cropped part
on the top left of the grid and allow natural clipping through its render
protip : surround with a ViewBox if the size needs to be fluid in your UI
<Grid Width="{Binding Part.Rect.Width}" Height="{Binding Part.Rect.Height}">
<Grid Width="{Binding Full.Width}" Height="{Binding Full.Height}">
Calebsem / MenuItem.cs
Created Nov 25, 2015
MVVM, UWP and MenuFlyout binding
View MenuItem.cs
// Using MVVM light, replace ViewModelBase with your MVVM framework
public class MenuItem : ViewModelBase
private readonly List<MenuItem> _items = new List<MenuItem>();
private readonly string _title;
private RelayCommand _command;
public MenuItem(string title)
: this(title, new RelayCommand(()=> { }, () => { return false; }))
Calebsem / bindableinkcanvas.cs
Created Sep 29, 2015
Bindable InkCanvas for UWP
View bindableinkcanvas.cs
using Windows.UI.Input.Inking;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
public class BindableInkCanvas : InkCanvas
public static readonly DependencyProperty StrokesProperty = DependencyProperty.RegisterAttached(
Calebsem / ViewController.m
Created Mar 6, 2014
GLKit starter ViewController
View ViewController.m
#import "ViewController.h"
@interface ViewController ()
@implementation ViewController
EAGLContext* context;
GLuint vertexArray; // our VAO
Calebsem / metronome.cs
Created Dec 19, 2013
C# Metronome for Unity3D
View metronome.cs
using UnityEngine;
using System.Collections;
public delegate void MetronomeEvent(Metronome metronome);
public class Metronome : MonoBehaviour {
public int Base;
public int Step;
public float BPM;
public int CurrentStep = 1;
View ruby rack
require 'json'
class IngeServer
def call(env)
@path = env['PATH_INFO']
@request =
You can’t perform that action at this time.