ui/src/
/entrypoints/main.ts
/store/configureStore.ts
/rootReducer.ts
/components/gallery/
/actions.ts
/gallery.scss
/dom.ts
/middleware.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@() | |
<div id="some-dom-id" class="gallery"> | |
<h5>Redux Example </h5> | |
<div class="image-wrapper"> | |
@* Generate list of random images for demo purposes *@ | |
@for(i <- 1 to 5) { | |
<img src="https://source.unsplash.com/random/300x300?sig=@{i}" /> | |
} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some CSS styles for our component | |
import "./gallery.scss"; | |
/** | |
* DOM mutations. Include all DOM manipulation for this component here | |
*/ | |
export const mutations = { | |
select: (index: number) => { | |
mutations.clearSelected(); | |
const images = elements.images(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "jest"; | |
describe("DOM image manipulation", () => { | |
test("applies class to image on applyFilterToImage", () => { | |
document.body.innerHTML = ` | |
<div id="some-dom-id"> | |
<div class="image-wrapper"> | |
<img class="image selected" src="testImage"> | |
<img class="image" src="testImage2"> | |
<img class="image" src="testImage3"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Typescript Intro</title> | |
<meta charset="utf-8"> | |
<style> | |
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 1. Write a product function that calculates the product of the values of a function for the points on a given interval | |
*/ | |
def product(f: Double => Double)(a: Double, b: Double): Double = { | |
def loop(a: Double, acc: Double): Double = | |
if(a > b) acc else loop(a+1, f(a) * acc) | |
loop(a, 1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Criteria: Every closing parenthesis ) must have a unique opening ( parenthesis before it | |
* | |
* For every closing parenthesis, we search for the first opening parenthesis and remove it, and keep going | |
*/ | |
def balance(chars: List[Char]): Boolean = | |
(chars.indexOf(')'), chars.indexOf('(')) match { | |
case (leftMostClosing, leftMostOpening) if leftMostClosing == -1 && leftMostOpening != -1 => false // no closing / some opening => fail | |
case (leftMostClosing, leftMostOpening) if leftMostClosing == -1 && leftMostOpening == -1 => true // no closing or opening => ok | |
case (leftMostClosing, leftMostOpening) if leftMostClosing != 1 && leftMostOpening == -1 => false // closing but no opening => fail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Github Webhook event types | |
* https://developer.github.com/v3/activity/events/types/ | |
*/ | |
module IWebhook { | |
interface IUser { | |
login: string, | |
id: number, | |
avatar_url: string, |
-
Async w/ RxJS: Slides showing a bit why RxJS is useful in comon scenarios
- Reactive.io learn seaction: Tutorial to learn a bit about reactive programming
- Reactive Koans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Json Wrapper: Wraps Stdin input into json template for logging purposes. | |
# | |
# The idea is to use this script to wrap logs from cli commands so they can be used | |
# for rsyslog @cee log processing. | |
# | |
# Author: Inaki Anduaga <[email protected]> | |
# | |
# Usage: <COMMAND> | ./jsonWrap.pl <MODE> <CHANNEL> <KEY1:VAL1> <KEY2:VAL2> ... |