Skip to content

Instantly share code, notes, and snippets.

View faried's full-sized avatar

Faried Nawaz faried

View GitHub Profile
@faried
faried / maildirtocouch.py
Created February 1, 2011 22:02
Store messages in a Maildir into a couchdb database.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from mailbox import Maildir
from optparse import OptionParser
import os
from pprint import pprint
import sys
from uuid import uuid4
@faried
faried / keybase.md
Last active June 1, 2020 14:46
keybase

Keybase proof

I hereby claim:

  • I am faried on github.
  • I am self (https://keybase.io/self) on keybase.
  • I have a public key ASCAda_Tll1oZAJk6_M2x0VzhXSalabSMG4nyeEwZ3VhqQo

To claim this, I am signing this object:

@faried
faried / maildirtocouch.py
Created February 9, 2011 21:37
Parse out a few headers, store doc in db and then attach email attachments.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from email.header import decode_header
from email.utils import parseaddr, getaddresses
import logging
from mailbox import Maildir
from optparse import OptionParser
import os
@faried
faried / booklist.py
Created December 11, 2010 19:22
read a list of isbn numbers from a google docs spreadsheet, update related title/author cells.
#!/usr/bin/env python
"""Get title/author for ISBNs in a Google Docs spreadsheet."""
from getpass import getpass
import os
import os.path
import sys
from gdata.spreadsheet import service, SpreadsheetsList
from gdata.books import service as bservice
@faried
faried / fbtest.dart
Created January 31, 2017 17:49
using the dart firebase package on my laptop.
/*
* pubspec.yaml:
*
* name: dconsole1
* version: 0.0.1
* description: A simple console application.
* dependencies:
* firebase: '^3.0.0'
* http: '^0.11.3'
* googleapis_auth: any
@faried
faried / wmweather.diff
Created October 22, 2016 11:34
diff to get wmweather 2.4.5 to work again
--- wmweather-2.4.5/src/wmweather.c~ 2016-08-04 00:20:09.027746575 +0500
+++ wmweather-2.4.5/src/wmweather.c 2016-08-04 00:16:08.836421544 +0500
@@ -62,7 +62,7 @@
static struct memory
header = {NULL, 0};
char
- url[] = "http://weather.noaa.gov/pub/data/observations/metar/decoded/\0\0\0\0.TXT",
+ url[] = "http://tgftp.nws.noaa.gov/data/observations/metar/decoded/\0\0\0\0.TXT",
xtitle[] = "weather report for \0\0\0\0\0",
*station = NULL,
{
"log":[
"REST",
"Shadow",
"CRUD",
"CRUD+",
"HTTP",
"HTTP+",
"Access",
"Changes",
@faried
faried / figlet.py
Last active June 30, 2016 21:27
python-rtmbot/plugins/figlet/figlet.py
from __future__ import unicode_literals
from json import loads
from optparse import OptionParser
from shlex import split
from pyfiglet import Figlet
crontable = []
outputs = []
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] Throwing new exception 'length=146; index=1542' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=146; index=1542
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void com.failapp.fragments.LoginFragment.onClickedSignIn(android.view.View) (LoginFragment.java:100)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void com.failapp.fragments.LoginFragment$$ViewBinder$1.doClick(android.view.View) (LoginFragment$$ViewBinder.java:24)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void butterknife.internal.DebouncingOnClickListener.onClick(android.view.View) (DebouncingOnClickListener.java:22)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at boolean android.view.View.performClick() (View.java:5204)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:13
@faried
faried / explode.el
Created February 11, 2016 08:09
this can get annoying.
;; i'm using it in
;; "GNU Emacs 25.1.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1134)) of 2015-12-09"
;; explode.wav is at
;; https://web.archive.org/web/20051029193334/http://www.arcanewolf.com/wizard/sounds/explode.wav
;; ring-bell-function described at https://www.emacswiki.org/emacs/AlarmBell
(setq ring-bell-function
(lambda ()