Skip to content

Instantly share code, notes, and snippets.

View netotz's full-sized avatar
📐

Ernesto Ortiz netotz

📐
View GitHub Profile
@DanielFL0
DanielFL0 / app.js
Last active November 4, 2022 04:39
Create a simple node.js backend framework
import http from 'http'
function App () {
this.plugins = []
}
App.prototype.use = function (middleware) {
this.plugins.push(middleware)
}
def generate_code(number)
charset = Array('A'..'Z') + Array('a'..'z')
Array.new(number) { charset.sample }.join
end
org_string = ARGV.first || generate_code(100)
solution = ''
string = org_string.split('')
string.each_with_index do |letter, index|
next if index.zero?
@DanDiplo
DanDiplo / JS-LINQ.js
Last active July 19, 2024 03:02
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// 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 },