Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Juan Herrera jdjuan

🎯
Focusing
Block or report user

Report or block jdjuan

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
@jdjuan
jdjuan / google-calendars.md
Last active Jan 3, 2018
How to import/export public Google Calendars with one click
View google-calendars.md

Importing/Exporting public Google Calendars

It consist of 3 steps:

  1. Create a calendar
  2. Export a calendar
  3. Import a calendar

1. Create a Calendar

View mousedrag-2.js
const { fromEvent } = Rx.Observable;
const move$ = fromEvent(document, 'mousemove');
const log = x => console.log(x);
move$.subscribe(log);
View mousedrag-1.html
<!DOCTYPE html>
<html>
<head>
<title>Hello!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js"></script>
</head>
<body>
View mousedrag-3.js
import { paint } from './canvas.js';
const { fromEvent } = Rx.Observable;
const move$ = fromEvent(document, 'mousemove');
move$.subscribe(paint);
View mousedrag-4.js
import { paint } from './canvas.js';
const { fromEvent } = Rx.Observable;
const { skipUntil, takeUntil } = Rx.operators;
const move$ = fromEvent(document, 'mousemove');
const down$ = fromEvent(document, 'mousedown')
const up$ = fromEvent(document, 'mouseup')
const paints$ = move$.pipe(
skipUntil(down$),
View mousedrag-5.js
import { paint } from './canvas.js';
const { fromEvent } = Rx.Observable;
const { skipUntil, takeUntil, repeat } = Rx.operators;
const move$ = fromEvent(document, 'mousemove');
const down$ = fromEvent(document, 'mousedown')
const up$ = fromEvent(document, 'mouseup')
const paints$ = move$.pipe(
skipUntil(down$),
View mousedrag-6.js
import { paint } from './canvas.js';
const { fromEvent } = Rx.Observable;
const { takeUntil, mergeMap } = Rx.operators;
const move$ = fromEvent(document, 'mousemove')
const down$ = fromEvent(document, 'mousedown')
const up$ = fromEvent(document, 'mouseup')
const paints$ = down$.pipe(
mergeMap(down => move$)
View mousedrag-7.js
import { paint } from './canvas.js';
const { fromEvent } = Rx.Observable;
const { takeUntil, mergeMap } = Rx.operators;
const move$ = fromEvent(document, 'mousemove')
const down$ = fromEvent(document, 'mousedown')
const up$ = fromEvent(document, 'mouseup')
const paints$ = down$.pipe(
mergeMap(down => move$.pipe(takeUntil(up$)))
@jdjuan
jdjuan / meta-regimen.md
Last active Jun 15, 2018
Meta Regimen: How to stick to your habits
View meta-regimen.md

Meta Regimen

Lessons I've learned throughout the years to keep up with my habits.

1. Motivate Yourself 💪

Nothing will make you skip your habits more than the lack of motivation

  • Believe you can
  • Watch motivational videos
@jdjuan
jdjuan / pada.md
Last active Sep 19, 2018
The Official P.A.D.A Format: A standard for better meeting invites
View pada.md

P.A.D.A.

Purpose | Agenda | Documents | Actions

1. Context

Meetings are aimed at discussions where the perspective of attendees is key to solve important matters and reach conclusions. Meetings are not group working sessions that are aimed at getting something done. Meetings should range between 5 minutes and 30 minutes. Working sessions range from 30 minutes to 4 hours.

2. Meeting Invite

You can’t perform that action at this time.