Skip to content

Instantly share code, notes, and snippets.

View Stefan-Code's full-sized avatar

Stefan Kuntz Stefan-Code

View GitHub Profile
@Stefan-Code
Stefan-Code / python_send_email.py
Created January 5, 2016 17:34
Send an email using gmail in python
import smtplib
def send_email(user, pwd, recipient, subject, body):
"""
Sends an email using a gmail account.
"""
gmail_user = user
gmail_pwd = pwd
FROM = user
TO = recipient if type(recipient) is list else [recipient]
SUBJECT = subject
@Stefan-Code
Stefan-Code / ImgAltBookmarklet.js
Last active January 1, 2016 16:16
Image ALT Text bookmarklet (includes jQuery). Click on any image on page to show ALT text.
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3B%24('img').click(function()%20%7B%24(this).after(function()%20%7Breturn%20%22%3Cp%3E%3Ccode%3E%22%2B%24(this).attr('alt')%20%2B%20%22%3C%2Fcode%3E%3C%2Fp%3E%22%7D)%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@Stefan-Code
Stefan-Code / imageAltText.js
Last active December 31, 2015 17:01
Image Alt text onclick (requires jQuery)
$('img').click(function() {$(this).after(function() {return "<p><code>"+$(this).attr('alt') + "</code></p>"})})
@Stefan-Code
Stefan-Code / lintian.txt
Created November 7, 2015 21:33
Syncthing deb lintian output
E: syncthing: unstripped-binary-or-object usr/bin/syncthing
W: syncthing: hardening-no-relro usr/bin/syncthing
E: syncthing: debian-changelog-file-missing
E: syncthing: file-in-etc-not-marked-as-conffile etc/ufw/applications.d/syncthing
W: syncthing: unknown-control-file changelog
W: syncthing: unknown-control-file compat
E: syncthing: no-copyright-file
E: syncthing: description-contains-tabs
W: syncthing: no-section-field
W: syncthing: no-priority-field