Skip to content

Instantly share code, notes, and snippets.

View joeljuca's full-sized avatar
👨‍💻
Working on smt new

Joel Jucá joeljuca

👨‍💻
Working on smt new
View GitHub Profile
const aws = require('aws-sdk')
const s3 = new aws.S3({
accessKeyId: '<access-id>',
secretAccessKey: '<access-secret>'
})
s3.getObject({
Bucket: 'joelwallis',
Key: 'joel.json'
}, (err, payload) => {
@joeljuca
joeljuca / maumau-match-calc.js
Created October 22, 2017 01:33
The worst method possible to process match points
var report = `
Indu 120
Joel 18
Rama 56
--
Joel 52
Indu 14
Rama 46
--
Ido 72
const FAKE_CHALLENGES = (function () {
const fakeMeAFile = file => ({name: file, content: `<${file}-content>`})
const fakeMeAChallenge = challengeKey => ({
title: challengeKey,
files: ['index.js', 'readme.md', 'test.js'].map(fakeMeAFile)
})
return () => ['hello-world', 'fizz-buzz', 'foo-bar'].map(fakeMeAChallenge)
})()
const TEMPLATE = [
'<div class="MyComponent @classes" @attributes>',
' <p>',
' @message',
' </p>',
'</div>'
].join('\n').concat('\n')
const defaultParams = {
classes: '',
def counter(count_to)
Array(1..count_to)
.each { |n|
return 'Counting: ' + n.to_s
}
end
class HelloWorld
def hello
begin
# this return will actually be the return from HelloWorld.hello???
return 'Why?'
end
'Hello world!'
end
end
#!/bin/bash
#
# Calculates the MD5 hash of a given file. It uses hashing utilities powered by
# operating systems, but wraps them into a consistent interface.
OS=$(
case $(uname) in
(Darwin*) echo "mac";;
(Linux*) echo "linux";;
# TODO: implement MD5 hashing on Windows
@joeljuca
joeljuca / prototypes.js
Created April 27, 2017 00:50
Basics of prototype chaining and hierarchy
function Animal (animalName) {
this.name = animalName
}
Animal.prototype.walk = function () {
console.log('Walking around...')
}
function Cat (catName) {
Animal.call(this, catName)
@joeljuca
joeljuca / shouter.js
Last active April 10, 2017 15:07 — forked from michaelablackham/shouter
String Drills
function shouter(whatToShout) {
return whatToShout.toUpperCase() + '!!!';
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!

Keybase proof

I hereby claim:

  • I am joelwallis on github.
  • I am joelwallis (https://keybase.io/joelwallis) on keybase.
  • I have a public key ASBJAt3Lo5eMRpOQWeUyWlOK-wEYaERjW9xxRVBKn54WSwo

To claim this, I am signing this object: