Skip to content

Instantly share code, notes, and snippets.

View rozgo's full-sized avatar

Alex Rozgo rozgo

View GitHub Profile
@rozgo
rozgo / gist:f5c41d2a29399d0c3d52
Created April 29, 2015 15:51
F# PCL iOS Xamarin
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{F2A71F9B-5D33-465A-A702-920D77279786};{4925A630-B079-445D-BCD4-3A9C94FE9307}</ProjectTypeGuids>
<!-- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{380F0F87-E153-4FCF-A19F-75E1006BB24C}</ProjectTypeGuids> -->
<!-- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> -->
<!-- <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids> -->
<ProjectGuid>{14980659-6907-4542-95C4-054D54680FCA}</ProjectGuid>
@rozgo
rozgo / gist:a75a7c726bdd29022056
Created December 17, 2014 23:20
LZMA Compression Settings
LZMA Options:
level
Description: The compression level.
Range: [0;9].
Default: 5.
dictSize
Description: The dictionary size.
@rozgo
rozgo / gist:36bfe52f9548b273e9b8
Last active August 29, 2015 14:11
Render Monad WIP
set drawcall (0)
-set shader:Unified (1)
--set color:red (2)
---set shape:box (3)
---unset shape:box (3)
---set drawcall (4)
----set attrib (5)
----unset attrib (5)
---unset drawcall (4)
---set uniform (6)
module Signal
open System
type Function =
| Line
| Sine
| Square
| Triangle
| Sawtooth
@rozgo
rozgo / gist:2db80c908cbe085d82b3
Created December 2, 2014 10:26
Async.AwaitObservable
#nowarn "40"
type Microsoft.FSharp.Control.Async with
static member AwaitObservable (evt : IObservable<'a>) =
Async.FromContinuations (fun (cont, econt, ccont) ->
let rec callback value =
sub.Dispose ()
cont value
and sub : IDisposable = evt.Subscribe callback
())
// [snippet: Async socket server using F# async computations.]
open System
open System.IO
open System.Net
open System.Net.Sockets
open System.Threading
type Socket with
member socket.AsyncAccept() = Async.FromBeginEnd(socket.BeginAccept, socket.EndAccept)
// Creating new threads
open System
open System.Threading
//What will execute on each thread
let threadBody() =
for i in 1..5 do
//Wait 1/10 of a second
Thread.Sleep(100)
printfn "[Thread %d] %d ..."
module Bowel.Bow
module Player =
type UserId = UserId of string
type UserName = UserName of string
type Player =
{
UserId : UserId
@rozgo
rozgo / broker
Created September 26, 2013 00:17
#include <websocketpp/config/asio.hpp>
#include <websocketpp/server.hpp>
#include <iostream>
#include <websocketpp/common/thread.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
typedef websocketpp::server<websocketpp::config::asio> server;
using websocketpp::connection_hdl;
#include <SDKDDKVer.h>
#include <Windows.h>
#pragma warning(disable:4819)
#pragma warning(disable:4996)
// for OpenCV2
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/gpu/gpu.hpp"