This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Imagemagick < Formula | |
desc "Tools and libraries to manipulate images in many formats" | |
homepage "https://www.imagemagick.org/" | |
url "https://dl.bintray.com/homebrew/mirror/ImageMagick-7.0.9-7.tar.xz" | |
mirror "https://www.imagemagick.org/download/ImageMagick-7.0.9-7.tar.xz" | |
sha256 "73398cc626ebbb060d0df552b0db75de0c334f9626286284b627a6eb2a66ed19" | |
head "https://github.com/ImageMagick/ImageMagick.git" | |
bottle do | |
sha256 "ee96f35821b25aa1e0ae3c8163b471bb9a41bf353df98cf094321aeadf11bc27" => :catalina |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var posts = [ | |
{ id: "1abc", title: "First blog post", content: "..." }, | |
{ id: "2abc", title: "Second blog post", content: "..." }, | |
// plus d'articles | |
{ id: "34abc", title: "The blog post we want", content: "..." } | |
// encore plus d'article | |
]; | |
posts = _.keyBy(posts, "id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateEmail() { | |
// Valider le courriel ici et afficher un message d'erreur si invalide | |
} | |
var emailInput = document.getElementById("email-field"); | |
emailInput.addEventListener("keyup", _.debounce(validateEmail, 500)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var users = [ | |
{ firstName: "John", lastName: "Doe", age: 28, gender: "male" }, | |
{ firstName: "Jane", lastName: "Doe", age: 5, gender: "female" }, | |
{ firstName: "Jim", lastName: "Carrey", age: 54, gender: "male" }, | |
{ firstName: "Kate", lastName: "Winslet", age: 40, gender: "female" } | |
]; | |
var user = _.find(users, { lastName: "Doe", gender: "male" }); | |
// user -> { firstName: "John", lastName: "Doe", age: 28, gender: "male" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sortedArray = [1, 1, 2, 3, 3, 3, 5, 8, 8]; | |
var result = _.sortedUniq(sortedArray); | |
// -> [1, 2, 3, 5, 8] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var original = { foo: "bar" }; | |
var copy = original; | |
copy.foo = "new value"; | |
// copy -> { foo: "new value" } Yeah! | |
// original -> { foo: "new value" } Oops! | |
var original = { foo: "bar" }; | |
var copy = _.cloneDeep(original); | |
copy.foo = "new value"; | |
// copy -> { foo: "new value" } Yeah! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var users = [ | |
{ name: "John", age: 30 }, | |
{ name: "Jane", age: 28 }, | |
{ name: "Bill", age: 65 }, | |
{ name: "Emily", age: 17 }, | |
{ name: "Jack", age: 30 } | |
] | |
var reducedUsers = _.reduce(users, function (result, user) { | |
if(user.age >= 18 && user.age <= 59) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var posts = [ | |
{ id: "1abc", title: "First blog post", content: "..." }, | |
{ id: "2abc", title: "Second blog post", content: "..." }, | |
// more blog posts | |
{ id: "34abc", title: "The blog post we want", content: "..." } | |
// even more blog posts | |
]; | |
posts = _.keyBy(posts, "id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.deburr("déjà vu"); | |
// -> deja vu | |
_.deburr("Juan José"); | |
// -> Juan Jose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bar = { foo: { key: "foo" } }; | |
_.set(bar, "foo.items[0]", "An item"); | |
// bar => { foo: { key: "foo", items: ["An item"] } } | |
var name = _.get(bar, "name", "John Doe"); | |
// name => John Doe |
NewerOlder