There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.
Card = Struct.new(:suite, :rank) do | |
include Comparable | |
def precedence() = [SUITES_SCORES[self.suite], RANKS_SCORES[self.rank]] | |
def rank_precedence() = RANKS_SCORES[self.rank] | |
def suite_precedence() = SUITES_SCORES[self.rank] | |
def <=>(other) = self.precedence <=> other.precedence | |
def to_s() = "#{self.suite}#{self.rank}" |
Type crontab -l
to see your cron jobs. Type crontab -e
to edit them. You have to use Vim apparently.
Add a line like this:
0,30 * * * * /Users/YOURNAME/Documents/scripts/stretch.sh
That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.
Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.
stems = ARGF.read | |
.split | |
.each_cons(2) | |
.group_by { |word_pair| word_pair[0] } | |
def next_word ary | |
ary[rand(ary.length).to_i][1] | |
end | |
e = Enumerator.new do |e| |
//Directive | |
angularApp.directive('angularOdometer', function () { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
//Creates new instance of odometer for the element | |
new Odometer({el: element[0], value: scope[attrs.odometer]}); | |
//Watch for changes and update the element value (causing odometer to redraw) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000