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
use "promises" | |
use "time" | |
actor Main | |
let _env: Env | |
var _count: U64 = 0 | |
new create(env: Env) => | |
_env = env |
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 Spin do | |
use GenServer | |
def start_link(_ \\ []) do | |
GenServer.start_link(__MODULE__, :ok, []) | |
end | |
def init(_) do | |
schedule() | |
{:ok, []} |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
func main() { | |
go tick() |
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
input = [ | |
%{:a => %{ :b => %{ :c => :x } }, :name => "Moo" } , | |
%{:a => %{ :b => %{ :c => :y } }, :name => "Mah" } , | |
%{:a => %{ :b => %{ :c => :x } }, :name => "Mee" } , | |
%{:foo => :bar} | |
] | |
# search for those where e[a.b.c] == :x and give their names | |
input |
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
// ==UserScript== | |
// @name GoCD artifact directory download as Zip | |
// @namespace https://ledentsov.de | |
// @version 0.1 | |
// @description download gocd artifacts as zip | |
// @author DLed | |
// @match https://*:8154/go/tab/build/detail/*/*/*/*/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js | |
// @grant GM_addStyle | |
// ==/UserScript== |
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
package main | |
// Output: | |
// Config file: C:\Users\<username>\test.toml | |
// Viper: open C:\Users\<username>\test.toml: The system cannot find the file specified. | |
// Old credentials: &{ServerURL:https://example.com Username:testuser Secret:1wdw1} | |
// Enter password: ****** | |
// New credentials: {ServerURL:https://example.com Username:testuser Secret:blabla} | |
import ( |
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
# executable online at https://www.tutorialspoint.com/execute_elixir_online.php | |
ExUnit.start() | |
defmodule Diamond do | |
def of(char) do | |
0..line_count(char) - 1 | |
|> Enum.to_list | |
|> Enum.map(fn(pos) -> line(pos, char) end) | |
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
#mix new rest_unique --sup | |
#mix deps.compile && mix deps.get | |
#iex -S mix | |
#hey -n 200000 http://localhost:4444/ | |
defmodule RestUnique.Application do | |
@moduledoc false | |
use Application | |
def start(_type, _args) 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
demo_lines = ["col 0,col 1,col 2\n", "542,414,26\n", "335,950,113\n", "378,954,231"] | |
csv_stats = fn lines -> | |
lines | |
|> Stream.drop(1) | |
|> Stream.with_index | |
|> Stream.map(fn {value, index} -> | |
{ | |
value | |
|> String.trim |
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
using System; | |
using System.Linq; | |
using System.IO; | |
using System.Collections.Generic; | |
namespace cs_console | |
{ | |
class CsvStats | |
{ |