Skip to content

Instantly share code, notes, and snippets.

View ZevUhuru's full-sized avatar
🎧
Focusing

Zev ZevUhuru

🎧
Focusing
View GitHub Profile
@ZevUhuru
ZevUhuru / password_eval.js
Created November 29, 2018 07:54
PasswordEval
/*
The following solution has been improved to incorporate
requiring of the text module and to reflect a better
structure / functional design.
---
Unfortunately, a lack of sleep led to some disorganization
within the initial solution.
*/
const fs = require('fs');
@ZevUhuru
ZevUhuru / password_eval.js
Created November 29, 2018 07:43
TodayTix PasswordEval
const fs = require('fs');
const input = fs.readFileSync('./sample_input.txt').toString().split('\n');
const vowels = ['a', 'e', 'i', 'o', 'u'];
function isVowel(letter) {
return vowels.includes(letter);
};
export function resetPassword(access_token, password, confirm_password) {
let url = `https://vroom-com.appspot-preview.com/api/customers/newPassword?access_token=${access_token}`;
return fetch(url, {
method: 'PUT',
headers: {
'Content-Type':'application/json',
},
body: JSON.stringify({password: password, confirmation: confirm_password})
})
};
var stack = new Stack(); // instantiate a new stack object
stack.push(5); // adds 5 to the stack
stack.push(6);
stack.push(7);
stack.isEmpty(); // => False
stack.peek(); // => 7
stack.print(); // => 5,6,7
function Stack() {
// properties and methods go here.
var items = []; // stores the element of the stack;
// the push() method add elements to the end of the stack.
this.push = function(e){
items.push(e);
};
// the pop() method removes elements at the end of the stack and returns them.
Verifying that +lemuel is my blockchain ID. https://onename.com/lemuel
def function
array = ["pblake", "xashley", "zkatie", "asteven"]
array.sort do |a,b|
a[1] <=> b[1]
end
end
arr = [1,2,3,4,5,6,7,8,9,10]
other_arr = []
arr.each do |a|
other_arr << a
end
puts other_arr[3]