View sieve_server.erl
This file contains 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
-module(sieve_server). | |
-export([sieve/1,start/1,sieve_loop/0,sieve_balancer/1,rpc/2,test/2,test_internal/2]). | |
test(Pid,Request) -> | |
spawn(sieve_server,test_internal,[Pid,Request]). | |
test_internal(Pid, Request) -> | |
receive |
View gist:7000a1587ab42dd2b752
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script"/> | |
</handlers> | |
<httpPlatform stdoutLogEnabled="true" stdoutLogFile="elixir.log" startupTimeLimit="20" processPath="C:\inetpub\wwwroot\azure-elixir\run.bat" | |
arguments=""> | |
<environmentVariables> | |
<environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%"/> |
View peer_channel.ex
This file contains 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
defmodule EphemeralShare.PeerChannel do | |
use Phoenix.Channel | |
require Logger | |
alias EphemeralShare.PeerManager | |
@doc """ | |
Join the topic `peer:<GUID>` and add the peer in the peer manager | |
""" | |
def join("peer:" <> peer_id, _auth_msg, socket) do |
View peer_state.ex
This file contains 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
defmodule EphemeralShare.PeerState do | |
require Logger | |
use GenServer | |
def start_link(peer_id) do | |
GenServer.start_link(__MODULE__, [peer_id], [name: {:global, peer_state_proc_id(peer_id)}]) | |
end | |
def stop(peer_id) do | |
peer_id |
View Codify Particle.lua
This file contains 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
p={} | |
ps=800 | |
touches={} | |
total=0 | |
-- Use this function to perform your initial setup | |
function setup() | |
print("Hello World!") | |
for i=0,ps do | |
p[i]= {x=math.random(WIDTH*10)/10, | |
y=math.random(HEIGHT*10)/10, ox=0.0, oy=0.0, vx=math.random(20)-10, |
View gulpfile.js
This file contains 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
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
eslint = require('eslint'), | |
babelify = require('babelify'), | |
source = require('vinyl-source-stream'), | |
browserify = require('browserify'); | |
var paths = { | |
ALL: ['index.js', 'lib/*.js'], | |
JS: ['index.js', 'lib/*.js'], |
View messages_controller.ex
This file contains 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
defmodule EchoBot.MessagesController do | |
use MicrosoftBot.Phoenix.Controller | |
alias ExMicrosoftBot.Models.Message | |
def message_received(conn, %Message{} = message) do | |
session_id = message.conversationId | |
spawn fn -> | |
%{from: from, to: to, id: msgId} = message | |
context = %{"session" => %{ |
View weather_conversation_action.ex
This file contains 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
defmodule EchoBot.WeatherConversationAction do | |
use Wit.Actions | |
alias Wit.Models.Response.Converse, as: WitConverse | |
alias ExMicrosoftBot.Client | |
def say(_session_id, %{} = context, %WitConverse{msg: msg_to_send} = message) do | |
%{"session" => %{"from" => to, "to" => from, "msgId" => msgId}} = context | |
message_to_send = %{from: from, to: to, replyToMessageId: msgId, text: msg_to_send} | |
Client.send_message(get_bot_auth_data(), message_to_send) |
View SuaveBootstrapFlynn.fs
This file contains 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
module SuaveBootstrapFlynn | |
open Suave | |
open Suave.Successful | |
open Suave.Web | |
open Suave.Operators | |
open Suave.Filters | |
open System | |
open System.Net |
View FunctionBinder.ts
This file contains 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
interface CurriedFunction2<T1, T2, R> { | |
(t1: T1): (t2: T2) => R; | |
(t1: T1, t2?: T2): R; | |
} | |
interface CurriedFunction3<T1, T2, T3, R> { | |
(t1: T1): CurriedFunction2<T2, T3, R>; | |
(t1: T1, t2?: T2): (t3: T3) => R; | |
(t1: T1, t2?: T2, t3?: T3): R; | |
} |
OlderNewer