Skip to content

Instantly share code, notes, and snippets.

@hulet
hulet / lds_contacts.js
Created January 17, 2019 23:56 — forked from trevordixon/lds_contacts.js
This script downloads all of your lds.org contacts as a vCard file which can be imported into Google Contacts, MacOS Contacts, and many other contact managers. Sign in to lds.org, then open the developer console (http://debugbrowser.com/#chrome) and paste the following code into the console.
// First, get the unit number.
const getUnitNumber = fetch('https://www.lds.org/mobiledirectory/services/ludrs/1.1/mem/mobile/current-user-unitNo', {
credentials: 'include',
})
.then(response => response.json())
.then(response => response.message);
// Then download all contacts.
const getContacts = getUnitNumber.then(unitNumber => fetch(`https://www.lds.org/mobiledirectory/services/v2/ldstools/member-detaillist-with-callings/${unitNumber}`, {
credentials: 'include',
@hulet
hulet / gist:9cf94fe0c3a4a54250a5e3be28d92697
Created June 9, 2016 17:25 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@hulet
hulet / imperial_spider.py
Created April 21, 2016 23:21 — forked from danlamanna/imperial_spider.py
Scrapy crawling, pyEnchant spell checking.
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from spellchecker.items import SpellcheckItem
from BeautifulSoup import BeautifulSoup
import re,urllib,enchant
from string import strip
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@hulet
hulet / gist:7588973
Created November 21, 2013 20:25
SublimeLinter csslint_options
"csslint_options":
{
"adjoining-classes": false,
"box-model": false,
"box-sizing": false,
"bulletproof-font-face": true,
"compatible-vendor-prefixes": true,
"display-property-grouping": true,
"duplicate-background-images": true,
@hulet
hulet / enable_google_keyboard_shortcuts.sh
Created October 3, 2011 23:07 — forked from fancyremarker/enable_google_keyboard_shortcuts.sh
Re-enable Google Keyboard Shortcuts in Chrome on OS X, by editing cookie database directly
#!/bin/sh
# Force Google Keyboard Shortcuts experimental search in Chrome
COOKIEJAR=~/Library/Application\ Support/Google/Chrome/Default/Cookies
OLDCOOKIEVAL=$(sqlite3 "$COOKIEJAR" "select value from cookies where host_key = '.google.com' and name = 'PREF';")
NEWCOOKIEVAL=$(echo $OLDCOOKIEVAL | sed 's/GM=.*\:S=/GM=1\:ES=WBS\:S=/')
sqlite3 "$COOKIEJAR" "update cookies set value = '$NEWCOOKIEVAL' where host_key = '.google.com' and name = 'PREF';"