Skip to content

Instantly share code, notes, and snippets.

View gganley's full-sized avatar

Gregory Ganley gganley

  • Savant Systems
  • Sandwich, MA
  • 10:10 (UTC -04:00)
View GitHub Profile
{
"time_of_search": "2019-07-26T18:18:51.245804-04:00",
"query": "from:TwitterDev lang:en",
"top_words": [
{
"word": "a",
"count": 19
},
{
"word": "for",
#!/usr/bin/env python3
import re
import getopt
import sys
import os
import requests
import json
def get_toggl_command():
@gganley
gganley / toggle.el
Created May 12, 2019 17:59
Trying to get toggl in the mode line
(after! doom-modeline
(require 'json)
(require 'parse-time)
(defvar doom-modeline--toggl-timer nil)
(defun doom-modeline-toggl-timer ()
"Start/Stop the timer for github fetching."
(if (timerp doom-modeline--toggl-timer)
(cancel-timer doom-modeline--toggl-timer))
(setq doom-modeline--toggl-timer
@gganley
gganley / gh_sloc.sh
Created February 20, 2019 19:59
Determine the SLOC for all repos for any given user
mkdir temp && cd temp && curl https://api.github.com/users/$1/repos | jq -r ".[] | select(.fork == false) | .name" | xargs -I{} sh -c "git clone https://github.com/$1/{} --depth 1 && cd {} && cloc . --git --sql=../test --sql-append && cd .. && rm -rf {}"
import Cocoa
struct Auth: Codable {
let email: String
let pw: String
}
struct Confirmation: Codable {
let status: Bool
}
(require '[datomic.api :as d])
(def uri "datomic:mem://pogchamp")
(d/create-database uri)
(def conn (d/connect uri))
@(d/transact conn [[
{:db/id #db/id[:db.part/db]
:db/ident :message/text
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
(defn lookup-past-broadcasts [chan]
(->> (client/get (format "https://api.twitch.tv/kraken/channels/%s/videos?limit=10000" chan)
{:content-type :vnd.twitchtv.v3+json
:query-params {"broadcasts" "true"}})
:body
parse-string
walk/keywordize-keys
:videos
(map (fn [x]
(-> x
(ns pogchamp.aleph
(:require [aleph.tcp :as tcp]
[gloss.core :as gloss]
[gloss.io :as gio]
[manifold.stream :as s]
[manifold.deferred :as d]))
(def protocol (gloss/string :utf-8 :delimiters ["\r" "\r\n"]))
(defn wrap-duplex-stream
(add-hook 'org-mode-hook
(lambda ()
(local-set-key (kbd "C-x C-s")
(lambda ()
(save-buffer)
(org-latex-export-to-pdf)))))