Skip to content

Instantly share code, notes, and snippets.

@hulufei
hulufei / toggl_import.py
Created July 30, 2018 01:37 — forked from khaeru/toggl_import.py
Toggl → Timewarrior import extension
#!/usr/bin/env python3
"""Toggl → Timewarrior import extension
© 2016 Paul Natsuo Kishimoto <[email protected]>
Licensed under the GNU GPL v3 or later.
Implements a Timewarrior extension (see
https://taskwarrior.org/docs/timewarrior/index.html) to import data from Toggl
(http://toggl.com).
type tree =
| Leaf(string)
| Node(Js.Dict.t(tree));
type dictTree = Js.Dict.t(tree);
type translations =
| Translations(Js.Dict.t(string));
let rec treeDecoder = json =>
@hulufei
hulufei / http-proxy-cookies.js
Last active October 10, 2018 09:50
http-proxy with cookies and gzip responses(Solved CORS limit)
var http = require("http"),
httpProxy = require("http-proxy");
var url = require("url");
var zlib = require("zlib");
var proxy = httpProxy.createProxyServer({});
proxy.on("proxyRes", function(proxyRes, req, res) {
console.log("Proxy response");
// res.headers = proxyRes.headers;
@hulufei
hulufei / vim-sexp-cheatsheet.md
Last active November 13, 2023 07:16 — forked from cszentkiralyi/vim-sexp-cheatsheet.md
vim-sexp cheatsheet

Prereqs

These are for the combined vim-sexp (https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people (https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp is neat on its own but Tim Pope makes common stuff much easier.

Note that some vim-sexp functionality depends on <LocalLeader> mappings. This is a different leader key than the global leader, and is the variable maplocalleader (instead of mapleader). To see if you have this set, use :echo maplocalleader; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader to <Space>, you'll need two commands in your .vimrc, since by default <Space> is bound to <Right> in normal mode:

nnoremap <Space> <Nop>
let maplocalleader=" "

TOC