Skip to content

Instantly share code, notes, and snippets.

@cloudRoutine
cloudRoutine / UnicodeMath.sublime-settings
Last active August 29, 2015 14:03
Custom symbol definitions for SublimeText plugin "UnicodeMath"
{
// Custom symbols
// Use it for your symbols, for example:
// {
// "mysymbol": "\u0021",
// "myothersymbol": "\u2080"
// }
// If symbols aren't displaying properly consider using a different font
// "DejaVu Sans Mono" has encodings for all glyphs in this file
@cloudRoutine
cloudRoutine / English-Integer.fs
Last active August 29, 2015 14:03
Function that takes a bigint as input and outputs its word form
let english_integer ( i : bigint ) : string =
let ZERO_TO_19 =
[ "zero" ; "one" ; "two" ; "three" ; "four" ; "five" ;
"six" ; "seven" ; "eight" ; "nine" ; "ten" ; "eleven" ;
"twelve" ; "thirteen" ; "fourteen" ; "fifteen" ; "sixteen" ; "seventeen" ;
"eighteen" ; "nineteen" ]
let HYPHEN_ONES =
[ "" ; "-one" ; "-two" ; "-three" ; "-four" ; "-five" ;
(*
Example Tree Print
------------------
______________[64]______________
/ \
____[73]_____ _____[88]
/ \ / \
[0] [13] [32]
/ \ / \ / \
@cloudRoutine
cloudRoutine / Ancestor-Tree.fs
Last active August 29, 2015 14:03
Prints Binary Trees In "Ancestor" Orientation ( AKA Leaves on the Top )
(*
Example Tree Print
------------------
[Grandfather] [Grandmother] [Grandpa] [Grandma]
|______________| |__________|
| |
[Dad] [Mom]
|_______________________|
|
@cloudRoutine
cloudRoutine / PipeTree.fs
Last active August 29, 2015 14:03
Prints Binary Trees in horizontal orientation connected by pipes
(*
Prints Trees Like
-----------------
[Node]
|
|_(1)_[Leaf]
|
|_(1)_[Node]
|
@cloudRoutine
cloudRoutine / xaml_reference.fs
Last active August 29, 2015 14:05
F# Xaml GUI Quick Reference
/// Xaml Reference
module MainApp =
// Imports
open System
open System.Diagnostics
open System.Windows
open System.Windows.Controls
namespace Scratch
open System
open System.Windows
open FsXaml
module ScratchModel =
type CustomQueryView = XAML<"CustomQuery.xaml">
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Scratch;assembly=App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="WindowRoot" mc:Ignorable="d"
Title="Tagger" Height="518.283" Width="320.582" AllowsTransparency="True" WindowStyle="None" MinWidth="100" MinHeight="100" BorderBrush="#FF6C6C6C" Background="{x:Null}" UseLayoutRounding="True" ResizeMode="CanResizeWithGrip" IsTabStop="False" IsManipulationEnabled="True">
<Window.Resources>
<Color x:Key="ScrollBar">#FF404040</Color>
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Scratch;assembly=App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="clr-namespace:System;assembly=mscorlib"
x:Name="ControlRoot"
mc:Ignorable="d" d:DesignWidth="238" d:DesignHeight="414" IsManipulationEnabled="True">
@cloudRoutine
cloudRoutine / gist:81c1db4b0d75353cf6d7
Created November 9, 2014 08:50
Ace Syntax Highlighting F#
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var FSharpHighlightRules = function ()
{