Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Meehan 22a

View GitHub Profile
View components.my-component\.js
import Component from '@ember/component';
import EmberObject, { computed } from '@ember/object';
export default Component.extend({
nums: undefined,
errors: undefined,
init() {
this._super(...arguments);
this.set('nums', [1,2,3,4,5]);
@22a
22a / index.js
Last active Oct 26, 2018
tcd <-> inter.com mentoring - high-low card game
View index.js
// importing readline library - basically a scanner equivalent
const readlineSync = require('readline-sync');
// define our number of guesses required to win as a constant
const winningNumberOfGuesses = 4;
// define a function that takes an integer card number and returns the english
// name string for that card 2->"2", 10->"Jack", etc.
// how you implement this doesn't matter all that much - here I've defined a
// hash of number to card name pairs and used the funtion's cardNum parameter
View components.ic-card-list.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@22a
22a / minesweeper.js
Created Nov 20, 2017
Functional Katas, Token! 20-11-2017
View minesweeper.js
const rows = 4
const columns = 4
const field = [
['*', '.', '.', '.'],
['.', '.', '.', '.'],
['.', '*', '.', '.'],
['.', '.', '.', '.']
]
@22a
22a / runlength.ex
Created Jun 8, 2017
Functional Katas, Elixir Special! 8-6-2017
View runlength.ex
defmodule Runlength do
def encode(string) do
String.codepoints(string)
|> List.foldl([], &count/2)
|> List.foldr("", &format/2)
end
defp count(char, [{char,n}|tail]) do
[{char, n+1}|tail]
end
View keybase.md

Keybase proof

I hereby claim:

  • I am 22a on github.
  • I am 22a (https://keybase.io/22a) on keybase.
  • I have a public key whose fingerprint is 41EB 5ACE E3F8 7739 2F91 1864 DF7C 74AF DC99 DF7C

To claim this, I am signing this object: