Skip to content

Instantly share code, notes, and snippets.

View eculver's full-sized avatar
🧠
Braining

Evan Culver eculver

🧠
Braining
View GitHub Profile
#!/bin/sh
#
# A hook script to check the commit log message for a Jira issue number.
test "" != "$(grep 'WD-' "$1")" || {
echo >&2 "ERROR: Commit message is missing Jira issue number."
exit 1
}
GET http://widm-cos.zmd.fedex.com:10099/iam/im/im/login/editFCLMySecurity.do?SMENC=UTF-8&USERNAME=evanculver&SMAUTHREASON=24&SMAGENTNAME=-SM-OpHyFGH8DMj4DjL7QkUcaKvAJVFKOiFfZ6KRIwgidFMO8Dsr%2bC2PSJIr8eaAQQFW&TARGET=-SM-HTTPS%3a%2f%2fwww%2efedex%2ecom%2flogin%2fredirect%3fTARGET%3dhttps-%3A-%2F-%2Fwww%2efedex%2ecom-%2Fwpor-%2Fweb-%2Fjsp-%2Fdrclinks%2ejsp-%3Flinks-%3Dwss-%2Fdevelop%2ehtml HTTP/1.1
Host: widm-cos.zmd.fedex.com:10099
Proxy-Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: fdx_cbid=29701262841374346906053350237101; IS3_GSV=DPL-0_TES-1374794741_PCT-1374794741_GeoIP-*_GeoCo-_GeoRg-_GeoCt-_GeoNs-_GeoDm-; fcl_lowbandwidth=no; fcl_registrationtype=; fcl_contactname=Evan Culver; fcl_fname=Evan; fcl_uuid=ZwHdjYkG9N;
<form action="/siteminderagent/forms/fdxlogin.fcc" method="post" name="logonForm" id="logonForm" onsubmit="addWSSInfo(username.value);">
<input type="hidden" name="SMENC" value="UTF-8">
<input type="hidden" name="TARGET" value=HTTPS://www.fedex.com/login/redirect?TARGET=https%3A%2F%2Fwww.fedex.com%2Fwpor%2Fweb%2Fjsp%2Fdrclinks.jsp%3Flinks%3Dwss%2Fdevelop.html>
<input type="hidden" name="SMAUTHREASON" value=0>
<input type="hidden" name="SMAGENTNAME" value=-SM-OpHyFGH8DMj4DjL7QkUcaKvAJVFKOiFfZ6KRIwgidFMO8Dsr+C2PSJIr8eaAQQFW>
@eculver
eculver / tests.py
Last active December 19, 2015 07:49
class UserTestCase(TestCase):
def test_get_full_name(self):
empty_email = ''
non_empty_email = '[email protected]'
empty_email_user = User(email=empty_email)
non_empty_email_user = User(email=non_empty_email)
empty_email_first_name = empty_email_user.get_first_name()
non_empty_email_first_name = non_empty_email_user.get_first_name()
@eculver
eculver / rm-unless-newest
Created July 3, 2013 05:03
Remove all directories except newest
ls -l | grep -v `ls -t | head -n1` | xargs sudo rm -rf
import json
from django.test import TestCase
from django.utils.http import int_to_base36
from django.core.urlresolvers import reverse
from provider.oauth2.models import Client as OAuthClient
from wdauth.apps.accounts.forms import ForgotPasswordForm
from wdauth.apps.accounts.models import Client as ClientAccount, User
from wdauth.apps.accounts.models import make_guid
@eculver
eculver / gist:5709144
Last active December 18, 2015 02:09
Get uWSGI processes and sort by memory usage in descending order.
ps v -C uwsgi-core | sort -k8nr
@eculver
eculver / .zshrc
Last active March 27, 2018 14:13
Reset Debian's ZSH command history cursor position blunder.
unsetopt global_rcs
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" up-line-or-history
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" up-line-or-history
[[ "$terminfo[kcuu1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" up-line-or-history
@eculver
eculver / git-log-helpers
Last active December 17, 2015 04:19
Handy one-liners for extracting info from git log.
# git log one-liners
# hash
git rev-parse HEAD | cut -c 1-7
git log --pretty=format:"%h" -1
git log --pretty=oneline --abbrev-commit | head -n1 | awk '{print $1}'
# message
git log --pretty=format:"%s" -1
git log --pretty=oneline --abbrev-commit | head -n1 | awk 'BEGIN{ORS=" "}{for(i=2;i<NF;i++){print $i}}'
SELECT
u.user_nicename,
m1.meta_value as points,
m2.meta_value as week
FROM
wp_users u,
wp_postmeta m1,
wp_postmeta m2,
wp_posts p
WHERE