Skip to content

Instantly share code, notes, and snippets.

View theY4Kman's full-sized avatar

Zach Kanzler theY4Kman

View GitHub Profile

Keybase proof

I hereby claim:

  • I am they4kman on github.
  • I am they4kman (https://keybase.io/they4kman) on keybase.
  • I have a public key whose fingerprint is 788A B90A 6A58 D285 2347 31A9 7D37 9477 B78F CE45

To claim this, I am signing this object:

import os
from django.conf import settings
from django.core.mail.message import EmailMultiAlternatives
from django.template.base import TemplateDoesNotExist
from django.template.loader import render_to_string
def email_from_template(template_dir, ctx=None, from_email=None, to=None):
"""Generate an Email message from a set of templates
// ==UserScript==
// @name Hive passwords utilities
// @description Highlights common passwords and copies to clipboard upon Reveal
// @match https://hive.hivelocity.net/admin/passwords/password/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require http://github.com/bartaz/sandbox.js/raw/master/jquery.highlight.js
// @grant GM_setClipboard
// @copyright 2013, Zach "theY4Kman" Kanzler
// ==/UserScript==
@theY4Kman
theY4Kman / ubersmith_recent_tickets.tamper.js
Last active August 11, 2017 13:13
GreaseMonkey/TamperMonkey userscript to show recent tickets on the Ubersmith view ticket page
// ==UserScript==
// @name Show Client's Recent Tickets
// @version 0.2
// @description List recent tickets of clients directly on the ticket view page
// @match https://manage.hivelocity.net/admin/supportmgr/ticket_view.php*
// @downloadURL https://gist.githubusercontent.com/theY4Kman/9653078/raw/ubersmith_recent_ticekts.tamper.js
// @grant GM_unsafeWindow
// ==/UserScript==
$ = unsafeWindow.$;
@theY4Kman
theY4Kman / ubersmith_quick_filter.tamper.js
Last active August 29, 2015 13:57
Quickly filter down and navigate to pages on Ubersmith's setup & admin page
// ==UserScript==
// @name Ubersmith Quick Filters
// @version 0.1
// @description enter something useful
// @match https://uberdev.hivelocity.net/admin/config/
// @match https://manage.hivelocity.net/admin/config/
// @require http://code.jquery.com/jquery-latest.js
// @copyright 2014 Zach "theY4Kman" Kanzler
// @grant GM_unsafeWindow
// ==/UserScript==
@theY4Kman
theY4Kman / gist:9556817
Created March 14, 2014 21:01
Return a PHP print_r of a JSON encoded object... I use it to show dict structures to PHP peeps.
import json
import subprocess
def php_print_r(obj):
return subprocess.Popen(['php', '-r', 'print_r(json_decode(file_get_contents("php://stdin")));'], stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate(json.dumps(obj))[0]
@theY4Kman
theY4Kman / django_ignore_mysql_warnings.py
Created March 11, 2014 16:49
Disables MySQL warnings in Django. I place it somewhere in my settings module. My use case is I develop on multiple branches, some with different database migrations, and I don't have a proper setup with a different database for each, so when I have to add a hotfix, MySQL sometimes complains about stupid shit. I don't really care about it, so I …
# Ignoring MySQL warnings, such as:
# "Field 'discount_id' doesn't have a default value"
IGNORE_MYSQL_WARNINGS = True
if IGNORE_MYSQL_WARNINGS:
_GOT_FIRST_REQUEST = False
def on_first_request(signal, sender):
global _GOT_FIRST_REQUEST
if not _GOT_FIRST_REQUEST:
_GOT_FIRST_REQUEST = True
@theY4Kman
theY4Kman / github-issues-list-assignees.tamper.js
Last active August 29, 2015 13:55
Shows clickable assignees list to filter issues by
// ==UserScript==
// @name GitHub Issues list assignees
// @version 0.1
// @description enter something useful
// @match https://github.com/*/*/issues?*
// @match https://github.com/*/*/issues/*
// @match https://github.com/*/*/issues
// @grant GM_unsafeWindow
// @grant GM_getValue
// @grant GM_setValue
@theY4Kman
theY4Kman / hallo-directive.coffee
Created December 29, 2013 04:48
An Angular directive for the HalloJS library, written in CoffeeScript, implementing Angular's Strict Contextual Escaping. By default, the model will get HTML, but providing the "text-only" attribute (its existence is enough, no need for a value) sets the value to just the text (the jQuery or jqLite .text() method).
app.directive 'hallo', ['$parse', '$sce', ($parse, $sce) ->
###
This directive allows for easy implementation
of the hallo content editing plugin
Taken from http://jsfiddle.net/XjMQy/41/
###
restrict: 'AC'
scope: true
compile: (tElement, tAttrs) ->
@theY4Kman
theY4Kman / gist:7979622
Created December 15, 2013 23:05
Ambition and Procrastination

I want to do everything. I want to do it now. But not really everything. I want to do the important things, the interesting things, the cool things. No, not those other things; those things are useless. Those things don't improve the world; are you kidding?

This looks awesome; I want to be an expert at it! Ooooh, this looks awesome; I want to be an expert at it! Holy shit, this is cool as hell; I want to know everything about it! Oh, yeah, I know about that; I fell in love with it years ago. No, I don't remember much about it.

Today, I'm gonna do some work. Just gotta go to the bathroom. Today, I'm gonna work on... uhh, I'm gonna do something! Just let me stay up to date by checking Hackernews. I'm hungry, lemme eat. Alright, time to work on... uhh, well... after a page of reddit I'll think of something. Oh, right, I was going to hook up postgres to my blog. Too late now, time for a drink and a movie. Tough day!

Just another episode, then I'll go to bed. Alright, I'll hit up reddit for a few minutes, then