2015-10-21
- jennifer
- martym
#!/usr/bin/env python3 | |
class A: | |
def dec(func): | |
def wrapper(self, *args, **kwargs): | |
print("Pre") | |
func(self, *args, **kwargs) | |
print("Post") | |
return wrapper |
{ | |
"rules": [ | |
{ | |
"rulePriority": 10, | |
"description": "For `latest` tag, keep last 5 images", | |
"selection": { | |
"tagStatus": "tagged", | |
"tagPrefixList": ["latest"], | |
"countType": "imageCountMoreThan", | |
"countNumber": 5 |
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
REPO_NAME="jenkins-master" | |
function manifest() { |
#!/usr/bin/env python | |
import io | |
import os | |
import tarfile | |
import requests | |
import stash | |
SITE_PACKAGES = os.path.expanduser("~/Documents/site-packages-3") |
#!/usr/bin/env python | |
# encoding=utf8 | |
""" | |
This script will cleanup leftover resources(instance, key-pair and security group) | |
related to an instance specified by its ipaddr or instance-id. | |
I frequently ran out of time when I have a packer debug session open and | |
the saml role only grant me one hour of access. So instead of manually | |
removing the keypair and the security group, I come up with this script. | |
""" |
# For this codewar question: https://www.codewars.com/kata/54baad292c471514820000a3 | |
import math | |
def create_number_class(bases): | |
base = len(bases) | |
def __init__(self, value): | |
self.value = value |
import json | |
import sys | |
import requests | |
AUTH ={ | |
'username': "xiaket", | |
'password': "YourPasswordHere", | |
} |
#!/usr/bin/env bash | |
# | |
# Author: Kai Xia <[email protected]/[email protected]> | |
# Filename: 2m4b | |
# Date created: 2014-02-27 16:52 | |
# Last modified: 2014-02-27 16:52 | |
# Modified by: Kai Xia <[email protected]/[email protected]> | |
# | |
# Description: | |
# create an m4b audiobook file from a movie or an mp3 file. |