Skip to content

Instantly share code, notes, and snippets.

View davedash's full-sized avatar
🏠
Working from home

Dave Dash davedash

🏠
Working from home
View GitHub Profile
#!/bin/bash -e
CIRCLE_TOKEN=PRIVATE
API_ROOT=https://circleci.com/api/v1
_project=PRIVATE
_branch=circle-ci-test
URL=${API_ROOT}/project/${_project}/tree/${_branch}?circle-token=${CIRCLE_TOKEN}
@davedash
davedash / rdio.py
Created December 1, 2015 19:40
get all your playlists out of rdio
from rdioapi import Rdio
__author__ = 'davedash'
CLIENT_ID=''
CONSUMER_SECRET=''
def main():
r = Rdio(CLIENT_ID, CONSUMER_SECRET, {})
@davedash
davedash / awsstatus.js
Created September 23, 2015 19:10
Fix AWS status page.
// ==UserScript==
// @name Fix AWS Status
// @namespace http://davedash.com/
// @version 0.1
// @description Fix the status icons so they are more obvious
// @author Dave Dash
// @match http://status.aws.amazon.com/
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
# Import a blog post.
def ingest(external_post)
map = nil
MyStatsd.client.time('find_map') do
map = AuthorExternalMap.find_by_external_id(external_post.author_id)
end
if map.present?
author = nil
MyStatsd.client.time('find_author') do
@davedash
davedash / long_task.rb
Last active August 28, 2015 17:54
No timing
# Import a blog post.
def ingest(external_post)
map = AuthorExternalMap.find_by_external_id(external_post.author_id)
if map.present?
author = Author.where(id: map.author_id).include(posts: [:categories]).try(:first)
category = Category.find_or_create_by!(name: external_post.category_name)
post = find_existing_post(external_post)
#!/bin/sh
set -e
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": "1",
"max_gram": "20"
},
"word_joiner": {
"type": "word_delimiter",
"catenate_all": true
"word_joiner": {
"type": "word_delimiter",
"catenate_all": true
}
{
"index": {
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram",
"min_gram": "1",
"max_gram": "20"
},
"word_joiner": {
#!/bin/bash -e
# This script finds IAM users who have passwords but no MFA.
# Deal with them accordingly.
# Generate a report
aws iam generate-credential-report > /dev/null
# Download report.
REPORT=$(aws iam get-credential-report)