Skip to content

Instantly share code, notes, and snippets.

View lazywithclass's full-sized avatar

Alberto Zaccagni lazywithclass

View GitHub Profile
@lazywithclass
lazywithclass / exercises.scm
Last active October 23, 2017 16:02
Exercises after The Little Schemer chapter 2
;; write the function "2nd" that given a list of atoms
;; returns the second atom
;; return values for illegal cases are up to you
;; try to be reasonable though
(define 2nd
(lambda (lat)
;; ...
))
;; then write the results for these applications by running your function
(2nd '()) ;; ???
@lazywithclass
lazywithclass / blog-post.md
Last active October 22, 2017 13:07
[Teaching programming] Lesson two

[Teaching programming] Lesson two - lazyblog

From the previous lesson

It wasn't clear, and still isn't to me as of now, how S-exps are counted in a list, for example

;; how many are here? Is it 2?
(((a b c) d))
@lazywithclass
lazywithclass / exercises.scm
Last active October 16, 2017 22:02
Exercises after The Little Schemer chapter 1
;; given leq? that checks for lists equality
;; complete the following, so that the result is true
;; all these exercises can be solved with combinations of
;; car, cdr, cons
;; be creative!
;; this is just an example I solved for you :)
;; l -> (1 2 3)
;; m -> (0 1 2 3)
@lazywithclass
lazywithclass / blog-post.md
Created October 10, 2017 19:24
[Teaching programming] Lesson one

[Teaching programming] Lesson one - lazyblog

I hate to use "teaching" and "lesson", but those are the easiest words that come to mind right now.

I will be teaching a friend of mine how to program, from zero to (hopefully) web dev so she can see if it could be something she would like to do for a living.

The book

To give her the basic concepts I am going to use The Little Schemer. I feel like it's

161 - lazyblog

The end of 7 long months

It started in March 2017 and it ended this afternoon 19/09/2017, when I finally realised I am going to sign with this company.

The numbers

1) Write an algorithm (choose the language you prefer) that given a character string, for instance {‘c’,’a’,’i’,’o’,’p’,’a’}, will print out the list of characters appearing at least 2 times. In this specific example, it would return {‘a’}. Afterwards, comment out the cost in terms of space and time.

// I've left out validation to concentrate on the algorithm itself, I hope it's ok

// O(n) time
@lazywithclass
lazywithclass / blog-post.md
Last active July 26, 2017 10:07
Learning Vue.js

Learning Vue.js - lazyblog

A lot of time has passed since I willingly wanted to learn a frontend JS framework, I am doing it again because

  • Vue's docs seems to be detailed enough
  • there's a nice and easy way to start
  • I've used it for a take home assignment as part of a job interview and loved how it all came together easily and almost painless
  • enriches HTML the Angular.js way, so that's something I already know
@lazywithclass
lazywithclass / blog-post.md
Last active July 30, 2018 05:23
On tests, take home problems, and a HackerRank bookmarklet

On tests, take home problems, and a HackerRank bookmarklet - lazyblog

So recently I've been interviewing and as you can imagine that means doing take home problems and online tests.

I am not pointing fingers (so please continue hiring me lol), I am addressing the problem in the industry, because almost everyone is doing it in the same way, so you could say no one is directly responsible. Even though willingness to have a better process should be a thing.

@lazywithclass
lazywithclass / blog-post.md
Last active July 12, 2017 16:14
Implementing racket/trace in JavaScript

Implementing racket/trace in JavaScript - lazyblog

This is a blog post / diary of my journey through this task, as I'm writing this words I have no idea how and if I will be able to achieve the goal. But, if you're reading this, then probably there's hope.

Why

racket/trace prints calls to a function, that could be useful when dealing with recursion:

@lazywithclass
lazywithclass / blog-post.md
Created May 22, 2017 20:01
Spacemacs nodejs-repl configuration repacing Skewer

It took some time to figure out how to override Skewer's defaults, turns out this is what worked, without the hook it was not working.

(add-hook 'js2-mode-hook #'(lambda ()
                             (spacemacs/set-leader-keys-for-major-mode 'js2-mode
                               "'" 'nodejs-repl
                               "ee" 'nodejs-repl-send-last-sexp
                               "eb" 'nodejs-repl-send-buffer
 "er" 'nodejs-repl-send-region)))