Skip to content

Instantly share code, notes, and snippets.

♻️
Rebranding WIP

Marc Lundgren marclundgren

♻️
Rebranding WIP
Block or report user

Report or block marclundgren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View triangleNumber.js
const sum = ((a, b) => a + b)
const triangleNumber = (number) => {
const list = []
list.length = number
list.fill()
return list.map((_, index) => index + 1).reduce(sum, 0)
}
View sunflower-slice.js
// Sunflower Slice
// Chrome
'a 🌻'.slice(0, 3); // "a �"
// Firefox
'a 🌻'.slice(0, 3); // "a \ud83c"
// Safari
'a 🌻'.slice(0, 3); // "a " 👈 running this results in a string that cannot be copied to the clipboard
View crypto-with-no-stored-passwords.js
/* https://functional.works-hub.com/learn/how-i-encrypted-a-database-without-storing-the-keys-anywhere-9da75?utm_source=reddit&utm_medium=organicsocial&utm_campaign=j.kaplan */
const crypto = require('crypto');
// Uses the PBKDF2 algorithm to stretch the string 's' to an arbitrary size,
// in a way that is completely deterministic yet impossible to guess without
// knowing the original string
function stretchString(s, salt, outputLength) {
return crypto.pbkdf2Sync(s, salt, 100000, outputLength, 'sha512');
}
View key-stretching.md

Key Stretching

WEAK KEY

weak-key

It would take a computer about 3 MINUTES to crack your password

@marclundgren
marclundgren / controllers.application.js
Created Jan 4, 2018
you modified mdcClassNames twice
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View gist:33689aff0a8bf123da215b330d1df3cc
✍ Tattoo - yes
🏥Broken Bones - yes
🔫 Shot a gun - yes
😕 Quit a job - yes
✈️ Flown on a plane -yes
🚙💨 Driven 120mph - yes
🚁 Rode in a helicopter - yes
🍼 Watched someone give birth- no
😯 Watched someone die - yes
🏈 Been to an NFL game - no
View export-to-csv.js
/*
WIP - rewrite this javascript method to be a bit easier to maintain
https://jsfiddle.net/jossef/m3rrLzk0/
*/
const exportToCsv = (filename, rows) => {
const serializeRow = (serializedResult, cell, index) => {
let serializedCell = ''
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
You can’t perform that action at this time.