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, |
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 |
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%"/> |
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 ROP do | |
defmacro try_catch(args, func) do | |
quote do | |
(fn -> | |
try do | |
unquote(args) |> unquote(func) | |
rescue | |
e -> {:error, e} | |
end |
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 Expng do | |
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks] | |
def png_parse(<< | |
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, | |
_length :: size(32), | |
"IHDR", | |
width :: size(32), | |
height :: size(32), |
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 |
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 |
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'], |
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'), | |
babelify = require('babelify'), | |
source = require('vinyl-source-stream'), | |
browserify = require('browserify'), | |
watchify = require('watchify'), | |
browserSync = require('browser-sync').create(); | |
var paths = { | |
HTML: 'src/index.html', |
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" => %{ |
OlderNewer