Skip to content

Instantly share code, notes, and snippets.

@sguzman
sguzman / rxjs-counter.html
Created June 22, 2017 16:21
Simple incrementer/decrementer with rxjs
<!DOCTYPE html>
<html lang="en">
<head>
<title>RxJS Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.4.1/Rx.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
</head>
<body>
@sguzman
sguzman / rxjs-counter.html
Created July 7, 2017 03:50
Using RxJS to implement a simple counter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="author" content="Salvador Guzman" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>RxJS Counter</title>
@sguzman
sguzman / rxjs-counter2.html
Created July 7, 2017 03:57
A pretty Rxjs counter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="author" content="Salvador Guzman" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>RxJS Counter</title>
@sguzman
sguzman / white-text.css
Created July 7, 2017 04:11
Some simple styling for white headers
h1, h2, h3, h4, p, aside, button {
text-align: center;
text-shadow: 0 2px 3px rgba(0,0,0,0.4);
color: white;
font-weight: lighter;
font-size: 300%;
font-family: "PT Sans", sans-serif;
}
h2 {
@sguzman
sguzman / 2d-cntxt.html
Created July 8, 2017 00:30
2d HTML context example - draws a simple square with an arc on top
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Canvas 2d Example</title>
<style>
body {
margin: 0;
}
@sguzman
sguzman / build.sbt
Created November 4, 2017 04:25
A good template for build.sbt
/** Name of project */
name := "LeetCodeScala"
/** Project Version */
version := "1.0"
/** Scala version */
scalaVersion := "2.12.4"
/** Scalac parameters */
@sguzman
sguzman / README.md
Created November 13, 2017 14:50
Some nice looking badges

Scala

LeetcodeScraper

Travis License: Unlicense codecov HitCount contributions welcome

@sguzman
sguzman / build.sbt
Created November 15, 2017 12:12
a more complete sbt file
import sbt.Keys._
import scala.concurrent.duration._
/** Name of project */
name in Scope.Global := ""
/** Organization */
organization in Scope.Global := "com.github.sguzman"
@sguzman
sguzman / .travis.yml
Created November 15, 2017 15:10
A basic yaml file for scala/codecov build
language: scala
scala:
- 2.12.4
script:
- sbt clean coverage test coverageReport
after_success:
- bash <(curl -s https://codecov.io/bash)
@sguzman
sguzman / expres.js
Created November 23, 2017 20:27
Settings cors headers on express.js
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.get('/', function(req, res, next) {
// Handle the get for this route
});