This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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('example@gmail.com', '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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE ForeignFunctionInterface #-} | |
| -- Simple example of calling C from Haskell. | |
| -- | |
| -- $ ghci | |
| -- > :load FfiExample.hs | |
| -- > c_sin pi | |
| -- 1.2246467991473532e-16 | |
| -- | |
| -- $ ghc --make FfiExample.hs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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)) |
NewerOlder