Note: everything here is pretty specific to my usage/accounts and not written for public use... You'll probably have to tweak a bunch of stuff.
$ bean-extract config.py ~/Downloads # the csvs should be in here
# Gmail checker for Xmobar | |
# | |
# Install the ruby-gmail and mime gem to system | |
# Put the script under ~/path/to/gmail_checker.rb | |
# Make sure it is executable | |
require 'gmail' | |
gmail = Gmail.new('[email protected]', 'password') | |
mail_count = gmail.inbox.count(:unread) |
Note: everything here is pretty specific to my usage/accounts and not written for public use... You'll probably have to tweak a bunch of stuff.
$ bean-extract config.py ~/Downloads # the csvs should be in here
(defmacro template (text) | |
"Expand text like \"Hello <<name>>\" to (format \"Hello %s\" name)." | |
(let ((pattern "<<\\(.*?\\)>>")) | |
;; The regexp matches anything between delimiters, non-greedily | |
(with-temp-buffer | |
(save-excursion (insert text)) | |
(let ((matches '())) | |
(while (re-search-forward pattern nil t) | |
(push (match-string 1) matches) | |
(replace-match "%s" t t)) |
#!/usr/bin/env bash | |
# Original: https://alexcabal.com/creating-the-perfect-gpg-keypair/ | |
KEY=xyz | |
DATE=$(date +"%Y%m%d") | |
SCRIPT_BASEDIR=$(dirname "$0") | |
cd "${SCRIPT_BASEDIR}" | |
echo "This script is not for use in automation"; echo "Use it step by step"; exit 1 |
;;; simple-mode-line.el --- Simplified Mode Line for Emacs 24 | |
;; Author: Daehyub Kim <lateau at gmail.com> | |
;; URL: https://gist.github.com/4511988 | |
;; Version: 0.3 | |
;; Keywords: mode-line, color | |
;;; Commentary: | |
;; This simplified mode line is adjusted to *white* themes. |
(defun my-ido-find-tag () | |
"Find a tag using ido" | |
(interactive) | |
(tags-completion-table) | |
(let (tag-names) | |
(mapatoms (lambda (x) | |
(push (prin1-to-string x t) tag-names)) | |
tags-completion-table) | |
(etags-select-find (ido-completing-read "Tag: " tag-names nil nil | |
(thing-at-point 'word))))) |
{-# LANGUAGE ForeignFunctionInterface #-} | |
-- Simple example of calling C from Haskell. | |
-- | |
-- $ ghci | |
-- > :load FfiExample.hs | |
-- > c_sin pi | |
-- 1.2246467991473532e-16 | |
-- | |
-- $ ghc --make FfiExample.hs |
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
(defun mode-line-fill-right (face reserve) | |
"Return empty space using FACE and leaving RESERVE space on the right." | |
(unless reserve | |
(setq reserve 20)) | |
(when (and window-system (eq 'right (get-scroll-bar-mode))) | |
(setq reserve (- reserve 3))) | |
(propertize " " | |
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve))) | |
'face face)) |
#!/usr/bin/env stack | |
{- stack | |
script | |
--resolver lts-11.16 | |
--package bytestring | |
--package http-conduit | |
-} | |
-- usage: ./Main.hs | |
-- modify the baseUrl and ghcDateVersion to taste |