TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| [user] | |
| name = <ur-name> | |
| email = <ur-email> | |
| [core] | |
| editor = vim -f | |
| excludesfile = /Users/<name-of-mac>/.gitignore_global | |
| [color] | |
| ui = true | |
| [alias] | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit |
This is a list of tutorials I've written for the Ruby workshops I run for Women Who Code in London
| class Fixnum | |
| # Constant variable with 'unique' roman numerals, plus some special cases (e.g. "IV, IX, XC, CM...") | |
| ROMANS = { 1000 => "M", | |
| 900 => "CM", | |
| 500 => "D", | |
| 400 => "CD", | |
| 100 => "C", | |
| 90 => "XC", | |
| 50 => "L", |
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
Press minus + shift + s and return to chop/fold long lines!
Recently, I've been asked by a group of people to provide arguments that should convince developers and managers to use a CI/CD infrastructure. If you're a developer and you haven't been frozen in an icy lake somewhere in Greenland for the past 8-10 years, you don't need to be convinced. Please, move on. You'll only read what you're used to do daily. And to thank you for stopping by, here's a nice photo of a dog:
So, if you're still here, it means you're in doubt of how CI/CD will play a role in our software development utility belt. Although we all know that automated tests and even a simple CI/CD infrastructure are the foundation of modern software development practices, I wasn't able to answer their questions right on spot. I mean, it's obvious that what we do has benefits, but we still don't know how to quantify them. Often, we see folks banging their heads against the wall trying to figure out _wh
| var dns = require('dns'); | |
| function reverseLookup(ip) { | |
| dns.reverse(ip,function(err,domains){ | |
| if(err!=null) callback(err); | |
| domains.forEach(function(domain){ | |
| dns.lookup(domain,function(err, address, family){ | |
| console.log(domain,'[',address,']'); | |
| console.log('reverse:',ip==address); |
| def fizz_buzz_1(max) | |
| arr = [] | |
| (1..max).each do |n| | |
| if ((n % 3 == 0) && (n % 5 == 0)) | |
| arr << "FizzBuzz" | |
| elsif (n % 3 == 0) | |
| arr << "Fizz" | |
| elsif (n % 5 == 0) | |
| arr << "Buzz" | |
| else |