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 Main exposing (..) | |
{- | |
******************************************************************************** | |
Copyright 2016 Zachary Kessin | |
Released under the BSD3 licence | |
Test your Code for better code quiality | |
http://elm-test.com/?utm_source=gist&utm_content=template |
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 LineCircle do | |
@type point() :: {number, number} | |
@spec intersection([point()], point(), number()) :: [point()] | nil | |
def intersection([{x1, y1}, {x2, y2}], {cx, cy}, r) when is_number(r) do | |
dx = x2 - x1 | |
dy = y2 - y1 | |
dr = :math.sqrt(dx * dx + dy * dy) | |
matrix = x1 * y2 - x2 * y1 | |
discriminant = square(r) * square(dr) - square(matrix) |
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 LineCircleIntersection do | |
@type point() :: {number, number} | |
@spec intersection([point()], point(), number()) :: [point()] | nil | |
def intersection([{x1, y1}, {x2, y2}], {cx, cy}, r) when is_number(r) do | |
dx = x2 - x1 | |
dy = y2 - y1 | |
dr = :math.sqrt(dx * dx + dy * dy) | |
matrix = x1 * y2 - x2 * y1 | |
discriminant = square(r) * square(dr) - square(matrix) |
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(streaming). | |
-export([stream_data/1, out/1, stream_from_file/3]). | |
out(_Arg) -> | |
_Pid = spawn_link(?MODULE, stream_data, [self()]), | |
{streamcontent, "audio/mp3", <<>>}. | |
stream_data(Pid) -> | |
File = "/home/erlang/erlang-talk/audio.mp3", | |
FileHDL = open_file(File), | |
stream_from_file(Pid, FileHDL, 1). |
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
-label("Waistcoat\n%name\n%date") | |
body($back_length $front_length_to_side $blade $under_arm $breast $waist $bottom_of_front) -> | |
@A = $breast/2 right of @origin, | |
@M = @origin, | |
|top = @A to @origin, | |
@V = 0.75 inch down from @A, | |
@C = $back_length * 1 down from @V, | |
@B = $under_arm * 1 up from @C, |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
local http = require("socket.http") | |
function upload() | |
http.request("http://192.168.0.104:8080/xplane/pilot?23") | |
end | |
do_often("upload()") | |
upload() |
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
local http = require("socket.http") | |
function upload() | |
http.request("http://192.168.0.104:8080/xplane/pilot?23") | |
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(cover). | |
-export([ cover/0]). | |
cover()-> | |
io:format("~n********************************************************************************~n"), | |
io:format("Running Tests~n~n"), | |
cover:start(), | |
_R = cover:compile_beam_directory("ebin/"), | |
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
#!/bin/bash | |
vagrant ssh --command "cd /vagrant && make --directory /vagrant $*" |
NewerOlder