Skip to content

Instantly share code, notes, and snippets.

@yaodong
yaodong / gist:f5b785c5b17337ce1b9a
Created February 11, 2016 23:15
things cloud requests
login
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com
get key
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Authorization: Password pppppwwwwdddd" -H "Accept-Language: en-us" --compressed https://cloud.culturedcode.com/version/1/account/user%40exmaple.com/own-history-keys
get index
curl -H "Host: cloud.culturedcode.com" -H "Content-Type: application/json; charset=UTF-8" -H "Proxy-Connection: keep-alive" -H "Accept: */*" -H "User-Agent: ThingsMac/20803501mas (x86_64; OS X 10.11.3; en_US)" -H "Accept-Language: en-us" --compressed https:
@agladky
agladky / TodoistOverdue.py
Created January 11, 2016 13:36
Moving overdue tasks for today in todoist
# -*- coding: utf-8 -*-
import sys
from todoist import TodoistAPI
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from os.path import expanduser
import argparse
import configparser
@Wizmann
Wizmann / workflowy-with-image.js
Last active December 11, 2024 02:25
workflowy-with-image.js
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://workflowy.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
tell application "OmniFocus"
tell front window
set selectedItems to value of selected trees of content
set theKey to (do shell script "defaults read io.postach.kholodilov 'rescuetime.api.key'")
repeat with theTask in selectedItems
@tresni
tresni / gist:83b9181588c7393f6853
Last active September 7, 2024 02:35
Authy to 1Password

Moving Authy to 1Password

1Password 5.3 for OSX, 5.2 for iOS, and 4.1.0.538 for Windows support OTP. I've been using Authy for a while now, but the fact is, I haven't really been using 2FA for some time. As mentioned by 1Password in a recent blog post, having the OTP generator and password on the same device is very much not 2FA. It's just an expiring OTP, which can help, but let's not kid ourselves too much.

With that out of the way. One of the things that was interesting to me was moving my OTP out of Authy and into 1Password. I like the control I get with 1Password, but I didn't want to have to reset all my OTP right away, that would suck. So, I got to dissecting the Authy Chrome App to see what I could do.

Run the Authy Chrome app and make sure it's unlocked.

Now, enable Developer mode in Chrome. We'll need this to inspect the background application that stores al

@albertbori
albertbori / Installation.md
Last active July 8, 2025 07:20
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@toolness
toolness / get-flagged-message-info.js
Last active August 13, 2017 19:46
Outputs a JSON stream of information about all your flagged IMAP messages.
var _ = require('underscore');
var Imap = require('imap');
var JSONStream = require('JSONStream');
var USER = process.env.USER;
var PASSWORD = process.env.PASSWORD;
var HOST = process.env.HOST;
var MS_PER_DAY = 1000 * 60 * 60 * 24;
var MAX_AGE = MS_PER_DAY * 90;
@baderj
baderj / garmin_ant_demo.py
Last active July 20, 2023 03:19
Script to illustrate heart rate capturing with Ant+, see blog post at http://www.johannesbader.ch/2014/06/track-your-heartrate-on-raspberry-pi-with-ant
"""
Code based on:
https://github.com/mvillalba/python-ant/blob/develop/demos/ant.core/03-basicchannel.py
in the python-ant repository and
https://github.com/tomwardill/developerhealth
by Tom Wardill
"""
import sys
import time
from ant.core import driver, node, event, message, log
@wrouesnel
wrouesnel / getmail-idler.py
Last active April 4, 2018 22:34
A script to invoke getmail when accounts receive new mail. See http://wrouesnel.github.io/articles/A%20better%20Getmail%20IDLE%20client/ for more details.
#!/usr/bin/env python
# Getmail Idler Script v2
# Will Rouesnel
#
# This is a pure Python threading affair - there are better ways to do things
# epoll but there are much better libraries (like gevent) for that type of
# thing.
#
# Note: this script assumes you're running getmail with the "delete" option for
# the mailbox it checks - i.e. your inbox should always be cleared of all mail.