Skip to content

Instantly share code, notes, and snippets.

@timsu
timsu / prStats.ts
Last active December 12, 2024 16:40
PR Stats
import axios from "axios";
import { exec as execCb } from "child_process";
import { createObjectCsvWriter } from "csv-writer";
import { promisify } from "util";
const exec = promisify(execCb);
const GITHUB_TOKEN = process.env.GITHUB_ACCESS_TOKEN;
const OWNER = process.env.GITHUB_REPO_OWNER;
const REPO = process.env.GITHUB_REPO_NAME;
@timsu
timsu / repeats_plugin.rb
Created February 4, 2022 22:42
Astrid recurrence calculator
# task plugin helper
module RepeatsPlugin
FREQUENCY = {
"MINUTELY" => "minute",
"HOURLY" => "hour",
"DAILY" => "day",
"WEEKLY" => "week",
"MONTHLY" => "month",
"YEARLY" => "year"
@timsu
timsu / logdna.ex
Last active May 30, 2022 08:55
LogDNA Logger for Elixir
# Usage:
#
# Add worker(LogDNA.BatchLogger, []) to your application supervision tree.
# Add Mojito to your mix deps (or replace with HTTPoison or another HTTP library)
#
# Call LogDNA.BatchLogger.{debug / info / warn / error} to send logs to LogDNA
defmodule LogDNA do
require Logger
@url "https://logs.logdna.com/logs/ingest"
@timsu
timsu / history.js.coffee
Last active December 12, 2015 06:08
Coffeescript reference implementation for displaying activity hashes
# model history object example:
{ id: 102112, user_id: 5, column: "due", prev: null, value: "2012-02-06T14:17:21Z",
created_at: 1357859045 }
# method to return a string such as "completed this task" given a
# model_history object
# model - history display context, either "task" or "list"
history_string = (model) ->
if @task()
item = "<a href='#task-" + @task()[0] + "'>" + @task()[1] + "</a>"
@timsu
timsu / AndroidManifest.xml
Created February 15, 2011 21:28
UI widget for contacts email autocompletion
<uses-permission android:name="android.permission.READ_CONTACTS" />
public final class SimpleTask extends AbstractModel {
// --- properties
/** ID */
public static final LongProperty ID = new LongProperty(
TABLE, ID_PROPERTY_NAME);
/** Name of Task */
public static final StringProperty TITLE = new StringProperty(