This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::io; | |
| #[derive(Debug)] | |
| struct BSTNode { | |
| value: i32, | |
| left: Option<Box<BSTNode>>, | |
| right: Option<Box<BSTNode>> | |
| } | |
| impl BSTNode { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace BloomFilter | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| AddItem("test"); | |
| AddItem("test2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace BloomFilter | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| AddItem("test"); | |
| AddItem("test2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Start your rethinkdb instance with this flag: | |
| `--bind all` (or `bind=all` in the configuration file for your instance) | |
| Block external access to the web UI with these two commands: | |
| `sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP` | |
| `sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT` | |
| Install nginx (if you haven't already): | |
| `sudo apt-get install nginx` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Runnable from Linqpad 5 | |
| // Must install the Sigil nuget package and include the Sigil namespace | |
| void Main() | |
| { | |
| var createSample = GetMapperDelegate(); | |
| // try it out | |
| createSample(23, "Hello").Dump(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Microsoft.ServiceFabric.Services | |
| open Suave | |
| open Suave.Http.Successful | |
| open Suave.Web | |
| open System.Fabric | |
| open System.Threading | |
| open System.Threading.Tasks | |
| type SuaveService() = | |
| inherit StatelessService() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Step 0. Boilerplate to get the paket.exe tool | |
| open System | |
| open System.IO | |
| Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
| if not (File.Exists "paket.exe") then | |
| let url = "https://github.com/fsprojects/Paket/releases/download/0.31.5/paket.exe" | |
| use wc = new Net.WebClient() | |
| let tmp = Path.GetTempFileName() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Xamarin.Forms; | |
| using Xamarin.Forms.Maps; | |
| namespace YourNameSpace | |
| { | |
| public class App : Application | |
| { | |
| public App() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [alias] | |
| recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10" | |
| co = checkout | |
| cob = checkout -b | |
| coo = !git fetch && git checkout | |
| br = branch | |
| brd = branch -d | |
| brD = branch -D | |
| merged = branch --merged | |
| st = status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| using AppFunc = Func<IDictionary<string, obj>, Task>; | |
| using MidFunc = Func<AppFunc, AppFunc>; | |
| public class MidFuncType | |
| { | |
| private readonly AppFunc next; |
NewerOlder