- Sometimes it just gets flat-out confused and needs to be restarted.
:lsp-restart
in helixCtrl + Shift + P
and searchrestart language language server
in vscode
- Are you using lamdera? or elm-pages (which uses the lamdera compiler)?
- Tell your editor to use
lamdera
as theelm
path/command. - Try
lamdera reset
- ...you may need to trigger a build afterwards (e.g. by loading site after lamdera live)
- Try copying
~/.lamdera
to~/.elm
(supposedly this will be fixed in a future version)
- Tell your editor to use
- Sometimes setting up elm-tooling in the project will work when the global elm tools won't. Don't know why.
- Check logs. Search google and elm channels (below) for errors.
I like to mirror the process of "going to work" even when I'm working from home. Get dressed. Brush teeth. Etc. and physically move to a dedicated work space. Same for "coming home". And keeping consistent working hours. Basically anything you can do to put a line between "at work" and "at home" in your mind, and and it helps with your kids/family if you have them.
You have to fight the urge to "power through" when you start to get stuck. Since no one is looking over your shoulder it's easy to waste time spinning your wheels. Work on your "ask questions" reflex.
On that note, prefer asking in public channels over DMs. Better chance that you'll get an answer, and it can help others. And it also provides positive pressure to make sure you'll asking the question well, and combats the feeling that you might be bothering someone in particular.
The pomodoro technique is great. Focus on one thing for 25 mins (or any length that works for you) , then take a 5 min break. Physically get out of your chair and look at
# Everything in ruby is an object which is an instance of a class. Even classes | |
# themselves are objects that are instances of the class `Class`. | |
class Dog | |
end | |
puts Dog.class # => Class | |
# When you use the class keyword, you are opening a class to define instance | |
# methods for any instance of the class: |
module Stomach | |
def eat(food) | |
@contents ||= [] | |
@contents << food | |
end | |
def vomit | |
@contents.pop | |
end | |
end |
My experience is mostly with server-side web frameworks, so that's how I'll describe it:
- I start in an "outer" TDD loop:
- Write a functional test that hits the URL of the feature I'm testing This fails for a silly reason: no route, no template, etc. (scaffolding)
- I add only the piece of scaffolding that's causing the failure I'm seeing. At this point I'm just dealing with "glue" that the framework provides me.
- Repeat steps 3 until I hit some logic that isn't solved with simply writing together things the framework gives me.
- I call a function (or whatever) that doesn't exist yet but named for the logic I'm introducing. My integration test is now failing because it doesn't exist.
$ tmux --version | |
tmux: illegal option -- - | |
usage: tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name] | |
[-S socket-path] [command [flags]] | |
$ tmux --help | |
tmux: illegal option -- - | |
usage: tmux [-2CluvV] [-c shell-command] [-f file] [-L socket-name] | |
[-S socket-path] [command [flags]] |
class User: | |
def __init__(self, coolness_factor) | |
self.coolness_factor = coolness_factor | |
cool_user = User(coolness_factor=100) | |
uncool_user = User(coolness_factor=1) | |
def user_is_cool(user): | |
return user.coolness_factor > 50 |
class MyClass: | |
def __init__(one, two, three): | |
self.one = one | |
self.two = two | |
self.three = three | |
@classmethod | |
def my_factory_method(one, two, three=None): | |
if three is None: | |
return MyClassWithoutThree(one, two) |
class BaseModel: | |
fields = () | |
def __init__(self, **data): | |
for key, val in data.items(): | |
setattr(self, key, val) | |
class MyModel(BaseModel): | |
fields = ('field1', 'field2', 'field3') |