Skip to content

Instantly share code, notes, and snippets.

View alejofv's full-sized avatar

Alejandro Figueroa alejofv

View GitHub Profile
@alejofv
alejofv / JS-LINQ.js
Created January 20, 2020 17:01 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var style = 'html * { background: rgba(255, 0, 0, .1); box-shadow: 0 0 0 1px red; }'
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf(style) != -1) {
items.push(elements[i]);
}
@alejofv
alejofv / 0_reuse_code.js
Created January 22, 2016 15:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console