Skip to content

Instantly share code, notes, and snippets.

View fpapado's full-sized avatar

Fotis Papadogeorgopoulos fpapado

View GitHub Profile
@fpapado
fpapado / nested_updates_01.elm
Created December 27, 2017 11:34
Elm nested updates
module Main exposing (..)
-- Using let..in, newWhatever and inline functions
import Dict exposing (Dict)
type alias Model =
{ something : String
, somethingElse : String
@fpapado
fpapado / index_injecting.ts
Created December 20, 2017 11:38
Injecting Streams?
import xs, { Stream } from 'xstream';
import { initModule, MyMsg } from './module_injecting';
// Stuff
init(
xs.create({
start: function(listener) {
someSource$.subscribe(msg => {
// do stuff with someSource$ to get it in shape
@fpapado
fpapado / index.html
Last active December 19, 2017 23:39
PouchDB Replication Check
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>PouchDB Replication</title>
</head>
<body>
<script src="https://unpkg.com/pouchdb@6.1.0/dist/pouchdb.js"></script>
<script src="https://unpkg.com/pouchdb@6.1.0/dist/pouchdb.memory.js"></script>
@fpapado
fpapado / Box.js
Created December 6, 2017 16:02 — forked from tkh44/Box.js
styled-system with emotion.
import styled, { css } from 'emotion/react'
import { space, width, fontSize, color, responsiveStyle } from 'styled-system'
export const display = responsiveStyle('display')
export const flex = responsiveStyle('flex')
export const order = responsiveStyle('order')
const wrap = responsiveStyle('flex-wrap', 'wrap', 'wrap')
const direction = responsiveStyle('flexDirection', 'direction')
const align = responsiveStyle('alignItems', 'align')
@fpapado
fpapado / print_today.py
Last active January 18, 2024 08:17
Gets and prints the tasks for "today", from the Todoist API. Intended to be used alongside https://github.com/Doist/todoist-python.
# Use the todoist API to get tasks from the current day
import todoist
from datetime import datetime
# Log user in; switch to OAuth eventually...
api = todoist.TodoistAPI()
def get_todays_tasks(email, password):