Skip to content

Instantly share code, notes, and snippets.

View keystone_waistcoat.pattern
-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,
View Vagrantfile
# -*- 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
View check_data.lua
local http = require("socket.http")
function upload()
http.request("http://192.168.0.104:8080/xplane/pilot?23")
end
do_often("upload()")
upload()
View read_xrefs.lua
local http = require("socket.http")
function upload()
http.request("http://192.168.0.104:8080/xplane/pilot?23")
View vmake.sh
#!/bin/bash
vagrant ssh --command "cd /vagrant && make --directory /vagrant $*"
View flightschool_parser.ex
defmodule FlightschoolParser do
@moduledoc """
Documentation for FlightschoolParser.
"""
alias :hackney, as: Hackney
alias :timer, as: Timer
def run() do
result = get_states("http://www.flightschoollist.com/", "airplane-flight-schools/")
:file.write("airport_data.csv", :io_lib.format("~p~n", [result]))
View counter_test.exs
defmodule CounterTest do
use ExUnit.Case
use PropCheck.StateM
use PropCheck
require Logger
test "Start" do
{:ok, pid} = Counter.start_link(0)
assert Process.alive?(pid)
View counter.ex
defmodule Counter do
use GenServer
defstruct val: 0,
watches: []
def increment() do
GenServer.cast({:global, __MODULE__}, :increment)
end
View counter.ex
defmodule Counter do
use GenServer
def increment() do
GenServer.cast(__MODULE__, :increment)
end
def decrement() do
GenServer.cast(__MODULE__, :decrement)
end
View shuffle_cards.ex
defmodule ShuffleCards do
def suits() do
[:hearts, :spades, :clubs, :diamonds]
end
def cards do
[:ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, :jack, :queen, :king]
end
def shuffle() do