Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Júnior Garcia juniorgarcia

View GitHub Profile
@juniorgarcia
juniorgarcia / article-fp-js-example-1.1.js
Last active Apr 15, 2019
Artigo - Introdução a programação funcional com JavaScript - Exemplo 1.1
View article-fp-js-example-1.1.js
let numbers = [1, 5, 10];
const doubleValue = x => x * 2;
console.log("Map result: ", numbers.map(doubleValue)); // [2, 10, 20]
console.log("Numbers: ", numbers); // [1, 5, 10]
@juniorgarcia
juniorgarcia / article-fp-js-example-1.js
Last active Apr 15, 2019
Artigo - Introdução a programação funcional com JavaScript - Exemplo 1
View article-fp-js-example-1.js
let numbers = [1, 5, 10];
const doubleValue = x => x * 2;
console.log(numbers.map(doubleValue)); // [2, 10, 20]
@juniorgarcia
juniorgarcia / ClojureArticle-ClojureFunctionalExample.clj
Created Apr 29, 2018
Clojure Article - Clojure functional programming example
View ClojureArticle-ClojureFunctionalExample.clj
(use '[clojure.string :only (join)])
(def names ["John" "Doe"])
(defn writeAllNames [names]
(str (join ", " names) "."))
(println (writeAllNames names))
@juniorgarcia
juniorgarcia / ClojureArticle-JSFunctionalExample.js
Last active Sep 27, 2018
Clojure Article - JavaScript functional programming example
View ClojureArticle-JSFunctionalExample.js
let names = ["John", "Doe"];
let writeAllNames = (names) => names.join(', ') + '.';
console.log(writeAllNames(names));
@juniorgarcia
juniorgarcia / cleancaches.sh
Created Dec 2, 2017
Cleaning up Developers' Macs caches
View cleancaches.sh
#!/bin/bash
# === Cleaning up your Mac
# Author: Júnior Garcia<itamarjr91@gmail.com>
#
#
#
# Here we consider:
# - Xcode and simulator caches
# - Node modules (only from within your projects' folder)
# - Cocoapods
@juniorgarcia
juniorgarcia / File globbing on Linux - practical examples.md
Last active Feb 13, 2016
Practical examples of how to use file globbing on Linux terminal
View File globbing on Linux - practical examples.md

File globbing: Practical examples

For this examples, we will start creating the file structure. It's easier tounderstand. The $ character in the lines below don't need to be typed, they are just a hint like "hey, we're typing this on terminal".

To create the structure, do the following:

  1. Open your terminal and type: $ mkdir fileGlobbingLearning
  2. Open your folder: $ cd fileGlobbingLearning
@juniorgarcia
juniorgarcia / convertCases.js
Created Dec 7, 2015
Simple cases conversion using JavaScript
View convertCases.js
/* Using functional programming to convert cases */
function convertCase(text, callback) {
return callback.apply(null, [text]);
}
/* convert_to_snake_case */
function snakeCase(text) {
return text.replace(/\s+/g, '_').toLowerCase();
}
You can’t perform that action at this time.