Skip to content

Instantly share code, notes, and snippets.

Avatar
🔋
Recharging

Fotis Papadogeorgopoulos fpapado

🔋
Recharging
View GitHub Profile
@fpapado
fpapado / print_today.py
Last active Mar 27, 2021
Gets and prints the tasks for "today", from the Todoist API. Intended to be used alongside https://github.com/Doist/todoist-python.
View print_today.py
# 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):
@fpapado
fpapado / Box.js
Created Dec 6, 2017 — forked from tkh44/Box.js
styled-system with emotion.
View Box.js
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 / index.html
Last active Dec 19, 2017
PouchDB Replication Check
View index.html
<!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>
View index_injecting.ts
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
View nested_updates_01.elm
module Main exposing (..)
-- Using let..in, newWhatever and inline functions
import Dict exposing (Dict)
type alias Model =
{ something : String
, somethingElse : String
@fpapado
fpapado / 01_failing.js
Created Mar 18, 2018
nanotiming overlapping timers
View 01_failing.js
// Three operations (loops for simplicity).
// We want to time the first two separately and all three of them together.
// Ideally, the ordering of starting the timers would not matter.
// This case fails because the timer for the first two loops is started first
var nanotiming = require('nanotiming')
try {
var performance = require('perf_hooks').performance
var timeFirstTwo = nanotiming('my-loop')
@fpapado
fpapado / graphana_pride.css
Created Jun 27, 2018
Grafana Custom CSS for Pride
View graphana_pride.css
.scroll-canvas--dashboard {
background: linear-gradient(180deg, #f00000, #f00000 16.67%, #ff8000 16.67%, #ff8000 33.33%, #ffff00 33.33%, #ffff00 50%, #007940 50%, #007940 66.67%, #4040ff 66.67%, #4040ff 83.33%, #a000c0 83.33%, #a000c0) fixed;
}
@fpapado
fpapado / FauxButton.tsx
Last active Jul 12, 2018
Accessible `<button>` usurper
View FauxButton.tsx
import React from "react";
/**
* Accessible "button" usurper.
* Establishes the correct role, tabindex, and key/mouse interaction if interactive.
* Buttons activate on space and enter.
*
* NOTE: Gives 'disabled' attribute if interaction not provided.
*
* @see https://www.w3.org/TR/wai-aria-practices-1.1/#button
View SketchSystems.spec
Unpublished*
publish -> Published
Published
unpublish -> Unpublished
event exists -> Event
no event exists -> No Event
Placeholder*
@fpapado
fpapado / split_panels.js
Created Jul 23, 2018
SpeedCurve split panels
View split_panels.js
(function() {
'use strict';
// Your code here...
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';