AI/ML training, tools and links
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
function FindProxyForURL(url, host) { | |
// Exclude (support|venus|mercury).*.opdt.cc from the SOCKS5 proxy | |
if ( | |
shExpMatch(host, "support.*.opdt.cc") | |
|| shExpMatch(host, "venus.*.opdt.cc") | |
|| shExpMatch(host, "mercury.*.opdt.cc") | |
|| shExpMatch(host, "api.*.opdt.cc") | |
) { | |
return "DIRECT"; // Use direct connection for support.*.opdt.cc | |
} |
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
# This is an example of metaprogramming in the Elixir language. | |
# | |
# We will define a domain specific language (DSL) for the definition | |
# of a service which is watched by several sensors. | |
# Each sensor watches some property/functionality of the service and | |
# returns the result of the check. | |
# | |
# To determine if the service is functioning properly, we need functions | |
# to run all the sensors' code and gather the returned data. | |
# |
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
{ | |
"components": { | |
"responses": {}, | |
"schemas": { | |
"Location": { | |
"description": "", | |
"example": { | |
"city": "Raleigh", | |
"country": "USA", | |
"id": "iFC8QdVzBmC7hC3NhZfwTG", |
One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
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
#!/usr/bin/env sh | |
# -------------------------------------------------- | |
# DoItLive Session for Shell-Fu - Little know command line tools | |
# -------------------------------------------------- | |
#doitlive shell: /bin/zsh | |
#doitlive prompt: default | |
cd $MERCURY | |
# tmux intro |
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 Exercise42 do | |
@moduledoc """ | |
Documentation for `Exercise 4.2`. | |
""" | |
require IO | |
def sort(values) do | |
router = create_router() | |
Enum.each(values, fn v -> send(router, {:int, v}) 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
@doc """ | |
Parse data for a single line of the text file | |
""" | |
def parse_line(line, _num, index) do | |
String.downcase(line) | |
|> String.to_charlist() | |
|> Enum.with_index() | |
|> Enum.chunk_while( | |
{[], 0}, | |
fn {c, i}, {word, column} -> |
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 HW1 do | |
def flatten([]), do: [] | |
def flatten([head | []]), do: [head] | |
def flatten([[head] | [tail]]), do: [head | flatten(tail)] | |
def flatten([head | [tail]]), do: [head | flatten(tail)] | |
def flatten([head | tail]), do: [head | flatten(tail)] | |
def flatten(head), do: [head] | |
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
require Integer | |
defmodule HW1 do | |
def custom_sum(a, b) when is_number(a) and is_number(b), do: {:ok, round(a) + round(b)} | |
def custom_sum(_, _), do: {:error, :badarg} | |
def even_length([]), do {:error, :must_be_even} | |
def even_length(a) when is_list(a) do |
NewerOlder