Skip to content

Instantly share code, notes, and snippets.

@danigm
danigm / sendmail.py
Created March 4, 2010 07:44
Send mail with attachment in python
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.Utils import COMMASPACE, formatdate
from email import Encoders
import os
import time
import random
@danigm
danigm / git-img-diff
Created March 23, 2011 08:07
git image diff
#!/bin/bash
diff=0
if [ "$1" = "-d" ]
then
diff=1
shift
fi
if [ $# -eq 0 ]
diff --git a/trunk/KShowEncoding/Common/Version.h b/trunk/KShowEncoding/Common/Version.h
index 3af84fe..4b96d7f 100644
--- a/trunk/KShowEncoding/Common/Version.h
+++ b/trunk/KShowEncoding/Common/Version.h
@@ -1,5 +1,5 @@
#ifndef KSHOWGUI_COMMON_VERSION_H
#define KSHOWGUI_COMMON_VERSION_H
-#define KSHOW_REVISION_NUMBER "1997"
+#define KSHOW_REVISION_NUMBER "1998"
#endif // KSHOWGUI_COMMON_VERSION_H
@danigm
danigm / test_hmac.py
Created November 27, 2014 10:38
Agora HMAC generation and verification in python
#!/usr/bin/env python3
import hmac
import datetime
import time
KEY = b'123'
@danigm
danigm / corstest.py
Created January 31, 2018 08:49
hug cors example
import hug
from hug.middleware import CORSMiddleware
api = hug.API(__name__)
api.http.add_middleware(CORSMiddleware(api))
@hug.post('/demo')
def demo(name: 'your name'):
return {"result": "Hello {0}".format(name)}
#!/usr/bin/env python
from requests import get
from requests import delete
from json import dumps
USER = 'danigm'
PASSWORD = 'XXXX'
ORG = 'endlessm'
const {
Clutter, Pango, St
} = imports.gi;
var _updateMultiline = imports.ui.appDisplay.AppViewItem.prototype._updateMultiline;
var _init = imports.ui.appDisplay.AppViewItem.prototype._init;
var { AppViewItem } = imports.ui.appDisplay;
function init() {
}