- create tasks T{NNNN} asign them
- create a branch with name like "T{NNNN}-boo-hoo"
git checkout -b T1234-boo-foo
- commit changes on that branch until it gets ready to be reviewed
git commit -am 'first'
git commit -am 'now it works'
- check if it's lint free (NOTE: it runs lint against only modified files)
arc lint
- push a review request to the server. This will create a diff with id D{NNNN}
arc diff
json = ActiveSupport::JSON.decode(File.read('db/seeds/countries.json')) | |
json.each do |a| | |
Country.create!(a['country'], without_protection: true) | |
end |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV
variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).
With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.
Setting for the session:
def urlses(cl: ClassLoader): Array[java.net.URL] = cl match { | |
case null => Array() | |
case u: java.net.URLClassLoader => u.getURLs() ++ urlses(cl.getParent) | |
case _ => urlses(cl.getParent) | |
} | |
val urls = urlses(getClass.getClassLoader) | |
println(urls.filterNot(_.toString.contains("ivy")).mkString("\n")) |
#Understanding closures, callbacks and promises
For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.
10 months into my full-time dev career, and I would struggle to explain these words to a peer.
So I decided it was time to face my fears, and try to get my head around each concept.
Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.
My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.
My first approach was a launch configuration in launch.json
mimicking tape -r babel-register ./path/to/testfile.js
with babel configured to create inline sourcemaps in my package.json
. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for
attaching (instead of launch) to `babel-node
-- This gist shows how we can use abilities to provide nicer syntax for any monad. | |
-- We can view abilities as "just" providing nicer syntax for working with the | |
-- free monad. | |
ability Monadic f where | |
eval : f a -> a | |
-- Here's a monad, encoded as a first-class value with | |
-- two polymorphic functions, `pure` and `bind` | |
type Monad f = Monad (forall a . a -> f a) (forall a b . f a -> (a -> f b) -> f b) |
package org.bykn.refmap | |
import cats.data.State | |
import cats.effect.Sync | |
import cats.effect.concurrent.Ref | |
import java.util.concurrent.ConcurrentHashMap | |
import cats.implicits._ | |
/** |
scalacOptions ++= Seq( | |
"-deprecation", // Emit warning and location for usages of deprecated APIs. | |
"-encoding", "utf-8", // Specify character encoding used by source files. | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred | |
// "-language:experimental.macros", // Allow macro definition (besides implementation and application). Disabled, as this will significantly change in Scala 3 | |
"-language:higherKinds", // Allow higher-kinded types | |
// "-language:implicitConversions", // Allow definition of implicit functions called views. Disabled, as it might be dropped in Scala 3. Instead use extension methods (implemented as implicit class Wrapper(va |