Simple parser that takes Prismatic/Schema in and dumps JsonSchema out. Waow!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# | |
# CLI Tool for accessing instances via ssm without having to pass in params | |
# | |
# Dependencies: awscli, zsh (Included by default on Catalina) | |
# | |
HELP=$(cat <<-EOF | |
Usage: | |
ssm i-073404e8ece4624b5 [OPTIONAL] --profile staging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn allowed-host? | |
"Checks whether the given Inet Address for outbound request is allowed" | |
[^java.net.InetAddress inet-addr] | |
(try | |
(not (or (.isLinkLocalAddress inet-addr) ; 169.0.0.0/8 | |
(.isLoopbackAddress inet-addr) ; 127.0.0.1 | |
(.isAnyLocalAddress inet-addr) ; 0.0.0.0 | |
(.isMulticastAddress inet-addr) ; 224.0.0.0 to 239.255.255.255 | |
(.isSiteLocalAddress inet-addr) ; 10.0.0.0/8, 192.168.0.0/16 | |
)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { | |
"support old jira first"; | |
const descriptionElement = document.getElementById("description"); | |
if (descriptionElement) { | |
descriptionElement.value = "*What*:\n\n*Why*:\n\n*What does success look like?*\n\n*Testing Notes*\n\n*Technical Notes/Hints*\n\n"; | |
return; | |
} | |
"support new jira issue view"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# | |
# Clones Git Projects into directory of <projects_dir>/<group>/<repo_name> | |
# | |
# Tested with support for Github, Bitbucket & Sourcehut. | |
# | |
# By default, clones to $HOME/projects. This can be overriden by setting | |
# GIT_GET_PROJECTS_DIR to another directory. | |
# | |
# Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: snippet -*- | |
# name: action | |
# key: act | |
# expand-env: ((yas-indent-line 'fixed)) | |
# Depends on string-inflection package | |
# -- | |
export const ${1:$(string-inflection-upcase-function yas-text)} = '${1:$(string-inflection-upcase-function yas-text)}' | |
type ${1:$$(string-inflection-camelcase-function yas-text)}Payload = { | |
$0 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An awesome snippet for adding block comment lines in lisps | |
# Usage: | |
Type the following: | |
``` | |
bc <tab> Subscription Handlers <tab> | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ext | |
"This module adds default parameters to requests such as the ability to dynamically set the | |
user credentials. This pattern could be used to do many things such | |
as append {:debug true}, useful in an interactive environment." | |
(:require [clj-http.client :as http])) | |
(def ^:dynamic *additional-params* | |
"Available at any time to set additional params to | |
Automatically bound when `with-middleware` is used." | |
{}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete_instance(instance, args): | |
"""Given an instance, deletes it!""" | |
if instance: | |
print "Rolling back %s" % instance.id | |
instance.terminate() | |
@Rollback(delete_instance) | |
def create_instance(conn, kwargs): | |
"""Performs creation of instance by wrapping over the AWS API and injecting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use a state machine model | |
class State: | |
def __init__(self, name, chars): | |
self.name = name | |
self.chars = chars | |
def __contains__(self, item): | |
return item in self.chars | |
def __repr__(self): |