I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
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 Benchmarker do | |
def run(title, module, function, size \\ 1024, iterations \\ 100) do | |
times = for (_ <- 1 .. iterations) do | |
data = :crypto.strong_rand_bytes(size) | |
{duration, _value} = :timer.tc fn -> | |
apply(module, function, [data]) | |
end | |
duration | |
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
defmodule Lookup do | |
@wordfile "words.txt" | |
@external_resource @wordfile | |
@times 1_000_000 | |
@words @wordfile |> File.stream! |> Enum.map(&String.strip/1) | |
@hash_set Enum.into(@words, HashSet.new) | |
@map_set Enum.into(@words, MapSet.new) |
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
class PriorityQueue | |
attr_reader :elements | |
def initialize | |
@elements = [nil] | |
end | |
def <<(element) | |
@elements << element | |
bubble_up(@elements.size - 1) |
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
# Disable the "Are you sure you want to open this application?" dialog | |
defaults write com.apple.LaunchServices LSQuarantine -bool false | |
# Disable press-and-hold for keys in favor of key repeat | |
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false | |
# Set a fast keyboard repeat rate | |
defaults write NSGlobalDomain KeyRepeat -int 2 | |
# Decrease the initial time before a keyboard repeat |
$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
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
def gen_module(file, rest_body) do | |
# load things from the file here and assign them to variables | |
Module.create(<name>, quote bind_quoted: [rest_body: rest_body, var1: var1, ...] do | |
# now unquote() can be called here freely, it will be deferred until module compilation | |
# therefore, you can copy-paste your previous in-line code without the file loading part | |
def unquote(...)(...) do | |
unquote(...) | |
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
iex> use PipeInspect | |
nil | |
iex> "hello" |> String.reverse |> String.upcase |> String.downcase | |
"olleh" | |
"OLLEH" | |
"olleh" |
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
FROM ubuntu:precise | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -q -y wget | |
RUN apt-get install -q -y ca-certificates | |
RUN apt-get install -q -y make | |
## Ruby-install |
Concepts-Techniques-Models-Computer-Programming CMT это известная книжка CMT, за которой слава закрепилась не хуже чем у SICP
это из этой книжки классификация различных парадигм Если присмотришься, то увидишь, что Oz поддерживает большинство вариаций (с этой целью его и конструировали, чтобы можно было наглядно продемонстрировать различные подходы в одном языке)
NewerOlder