Instantly share code, notes, and snippets.

View gitlfsserver.sh
#!/bin/sh
### BEGIN INIT INFO
# 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.
### END INIT INFO
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}">
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; }))
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(
"Strokes",
typeof(InkStrokeContainer),
typeof(BindableInkCanvas),
View ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
{
EAGLContext* context;
GLuint vertexArray; // our VAO
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 = Rack::Request.new(env)
self.router
end