Skip to content

Instantly share code, notes, and snippets.

@bellkev
bellkev / error.txt
Created July 16, 2019 03:18
Error Log from Eclipse for CodeStar issue
!SESSION 2019-07-15 16:07:29.967 -----------------------------------------------
eclipse.buildId=4.12.0.I20190605-1800
java.version=12.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.mylyn.bugzilla.core 4 0 2019-07-15 16:07:35.342
!MESSAGE FrameworkEvent ERROR
#! /bin/bash
set -e
regions() {
aws ec2 describe-regions | jq -r '.Regions | .[].RegionName' | sort
}
@bellkev
bellkev / anki_dedup.py
Created August 1, 2016 04:56
Find duplicates (frequently recurring words) in Anki decks
from collections import defaultdict
import json
import sqlite3
DB_PATH='/Users/kevin/Desktop/91_copy/collection.anki2'
MODEL='Kanji-Kana-English'
DECK='KIC'
# Field used to show occurrences of the duplicated word
KEY_FIELD='Kanji'
@bellkev
bellkev / circle.yml
Created June 23, 2016 17:33
Deploy to ECS
deployment:
staging:
branch: master
commands:
- docker login -u $DOCKER_USER -e $DOCKER_EMAIL -p $DOCKER_PASS
- docker push bellkev/fantasticorp-home-uwsgi:$IMAGE_TAG
- docker push bellkev/fantasticorp-home-nginx:$IMAGE_TAG
- ./deploy.sh prod
@bellkev
bellkev / circle.yml
Created June 23, 2016 17:25
Deploy to s3
deployment:
# This is a simplified example of deploying to s3
simple:
branch: foo
commands:
- aws s3 sync --delete . s3://mybucket.com
# This is what we actually use to deploy our static site
advanced:
branch: staging
commands:
@bellkev
bellkev / circle.yml
Created April 27, 2016 19:42
custom-go-version
dependencies:
cache_directories:
- ~/custom-go-versions
pre:
- ./ensure-go-versions.sh 1.6
- ./select-go-version.sh 1.6
#!/bin/bash
read_machine_type() {
echo "Is this a services (1) or builder (2) machine?"
read machine_type
if [[ $machine_type -ne 1 && $machine_type -ne 2 ]]; then
echo "Please enter \"1\" or \"2\" then hit ENTER"
read_machine_type
fi
@bellkev
bellkev / circle.yml
Created September 19, 2015 23:52
deploy to EB
deployment:
elasticbeanstalk:
branch: master
commands:
- zip -r app-$CIRCLE_SHA1 .
- aws s3 cp app-$CIRCLE_SHA1.zip s3://$EB_BUCKET/app-$CIRCLE_SHA1.zip
- aws elasticbeanstalk create-application-version --application-name hello --version-label $CIRCLE_SHA1 --source-bundle S3Bucket=$EB_BUCKET,S3Key=app-$CIRCLE_SHA1.zip
- aws elasticbeanstalk update-environment --environment-name my-env --version-label $CIRCLE_SHA1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import hashlib
import json
import os
import random
import re
import time
#!/bin/bash
# Munge your codebase to add :verbose on all :require and :use forms and insert printlns in front of defns.
# $1: Path to directory you want to munge files in (recursively).
find "$1" -name '*.clj' -exec sed -i 's/\((defn\? \([a-z0-9<>_*+-]\+\)\)/(println "var \2")\n\1/' '{}' \;
find "$1" -name '*.clj' -exec sed -i 's/:\(require\|use\) /:\1 :verbose /' '{}' \;