This file contains hidden or 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 ErlangC do | |
def factorial_of(0), do: 1 | |
def factorial_of(n) when n > 0, do: n * factorial_of(n - 1) | |
def traffic_intensity(calls, reporting_period, average_handle_time) do | |
calls_per_hour = (60 / reporting_period) * calls | |
(calls_per_hour * (average_handle_time / 60)) / 60 | |
end | |
def probability_call_waits(traffic_intensity, agents) do |
This file contains hidden or 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
from datetime import datetime | |
from time import localtime, strftime, sleep | |
from urllib.parse import urlparse | |
import telepot | |
import requests | |
import subprocess | |
import platform | |
import csv | |
import os |
This file contains hidden or 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 glyphs = document.querySelectorAll("span.glyphicon-facetime-video"); | |
[].forEach.call(glyphs, function(elem){ | |
var row_link = elem.parentElement.parentElement.getAttribute("data-target"); | |
var run_url = "https://www.speedrun.com" + row_link | |
elem.classList.remove("glyphicon") | |
elem.classList.remove("glyphicon-facetime-video") | |
elem.innerHTML = "<a href='" + run_url + "'>VOD</a>" |
This file contains hidden or 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 Markov.Dictionary do | |
def new do | |
HashDict.new | |
end | |
def parse(dictionary, source) when is_binary(source) do | |
parse(dictionary, String.split(source)) | |
end | |
def parse(dictionary, [word1, word2 | rest]) do |
This file contains hidden or 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
import weechat, requests | |
weechat.register("ifttt", "rekyuu", "1.0", "MIT", "IFTTT: Send push notifications to IFTTT.", "", "") | |
settings = { | |
"trigger": "", | |
"token": "" | |
} |
This file contains hidden or 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/bash | |
~/.config/lemonbar/bar_clock \ | |
| lemonbar \ | |
-f "Hack:size=11" \ | |
-F "#FF000000" \ | |
-B "#FFFFFFFF" \ | |
-g 1920x20+1600+0 \ | |
wait |
This file contains hidden or 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
fizzword = fn | |
(0, 0, _) -> "fizzbuzz" | |
(0, _, _) -> "fizz" | |
(_, 0, _) -> "buzz" | |
(_, _, n) -> n | |
end | |
fizzbuzz = fn (n) -> | |
fizzword.(rem(n, 3), rem(n, 5), n) | |
end |
This file contains hidden or 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
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
host = socket.gethostname() | |
port = 4560 | |
# Connects to the server. | |
s.connect((host, port)) | |
print('Connected.') |
NewerOlder