Connected a Sky box via TP-Link 500Mbps to a Mac Mini.
It said "Self-assigned IP" and wouldn't connect to the Internet.
In the network settings for Ethernet:
# 238 chars (newlines count as one char) | |
c=&" #{&1} bottle#{&1>1&&"s"||""} of Elixir" | |
o=" on the wall" | |
for n<-99..1,do: Task.await Task.async fn->IO.puts [inspect(self),c.(n),o,?,,c.(n),". | |
",n<2&&"Go code some more,"<>c.(99)||"Take one down and pass it around,"<>c.(n-1),o,?.]end |
Assumes you have node.js and npm.
Create a file ~/.facebook-auth
containing your login email and password in the format [email protected]:my-password
.
# Danish "CVR-nummer". | |
# | |
# A 7 digit serial number followed by a mod-11 check digit: | |
# https://erhvervsstyrelsen.dk/modulus-11-kontrol | |
# | |
# Search for real CVRs, to see examples: https://datacvr.virk.dk/data/ | |
# E.g. 35408002, 30715063. | |
class DanishOrganizationNumber | |
MOD_11_WEIGHTS = [ 2, 7, 6, 5, 4, 3, 2 ] |
# Danish "CPR-nummer" or "personnummer". | |
# | |
# http://en.wikipedia.org/wiki/Personal_identification_number_(Denmark) | |
# https://sv.wikipedia.org/wiki/Personnummer#Danmark | |
# | |
# > It is a ten-digit number with the format DDMMYY-SSSS, where DDMMYY is the date of birth and SSSS is a sequence number. The first digit of the sequence number encodes the century of birth (so that centenarians are distinguished from infants), and the last digit of the sequence number is odd for males and even for females. | |
# > | |
# > … since October 2007 personal identification numbers do not always validate using the check digit. | |
class DanishIdentityNumber |
defmodule Example do | |
def unquote(:"foo bar")() do | |
IO.puts "hi!" | |
end | |
def unquote(:"täst")() do | |
IO.puts "hä!" | |
end | |
end |
defmodule MyMacro do | |
defmacro a(value, do_block) do | |
[{:a, value}|parse_do_block(do_block)] | |
end | |
defp parse_do_block([do: {:__block__, _, list}]) do | |
list |> Enum.map(&parse_name_and_value/1) | |
end | |
defp parse_name_and_value({name, _, [value]}) do |
defmodule Lab do | |
defmacro say({:when, _, [message, condition]}) do | |
{result, _} = Code.eval_quoted(quote do | |
case true do | |
true when unquote(condition) -> true | |
true -> false | |
end | |
end) | |
if result do |
defmodule Lab do | |
defmacro say({:when, _, [message, condition]}) do | |
{result, _} = Code.eval_quoted(condition) | |
if result do | |
quote do | |
IO.puts unquote(message) | |
end | |
end | |
end |
# Ruby script for DN subscribers to download the latest DN as a PDF – because it beats their iPad app. | |
# By Henrik Nyh 2015-12-08 under the MIT license. | |
# | |
# INSTRUCTIONS (for advanced users) | |
# | |
# Fetch the script dependencies: | |
# | |
# (sudo) gem install mechanize | |
# | |
# Put your username and password in a ~/.dnloader file separarated by a ":", e.g.: |