$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
class TLMBot { | |
constructor(minWaitTime = 5000, maxWaitTime = 15000) { | |
this.minWaitTime = minWaitTime; | |
this.maxWaitTime = maxWaitTime; | |
this.isMining = false; | |
this.isBotRunning = false; | |
this.startedAt = 0; | |
this.initialBalance = 0; | |
this.accumulate = 0; |
First, install nginx for mac with "brew install nginx". | |
Then follow homebrew's instructions to know where the config file is. | |
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
2. Copy it somewhere (use full path in the example below for server.* files) | |
3. sudo nginx -s reload | |
4. Access https://localhost/ | |
Edit /usr/local/etc/nginx/nginx.conf: |
module Ternary where | |
-- | Ternary operator. | |
-- Usage: (i > 0) ? i $ 1 | |
(?) :: Bool -> a -> a -> a | |
True ? x = const x | |
False ? _ = id | |
-- | Higher order ternary operator. | |
-- Usage: (not . null) ?? "" $ "default" |
The question was asked why I (as a programmer who prefers dynamic languages) don't consider static types "worth it". Here is a short list of what I would need from a type system for it to be truely useful to me:
- Full type inference. I would really prefer to be able to write:
(defn concat-names [person]
(assoc person :full-name (str (:first-name person)
(:second-name person))))
Functional programming gets a bad wrap about being too hard for mere mortals to comprehend. This is nonsense. The concepts are actually quite simple to grasp.
The jargon is the hardest part. A lot of that vocabulary comes from a specialized field of mathematical study called category theory (with a liberal sprinkling of type theory and abstract algebra). This sounds a lot scarier than it is. You can do this!
All examples using ES6 syntax. wrap (foo) => bar
means:
function wrap (foo) {
module Tuple2 | |
let replicate x = x, x | |
let curry f x y = f (x, y) | |
let uncurry f (x, y) = f x y | |
let swap (x, y) = (y, x) |
using System; | |
using System.Collections.Generic; | |
public static class ExtensionMethods | |
{ | |
public static IEnumerable<T> ToList<T>(this T value) { | |
yield return value; | |
} | |
public static IEnumerable<U> SelectMany<T, U>(this IEnumerable<T> m, Func<T, IEnumerable<U>> k) |
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 29 Jul 2015 01:52:41 GMT till Fri, 29 Jul 2016 01:52:41 GMT.
Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:
githubUsers
.filter(user => user.followers > 6)