This file contains 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
#!/usr/bin/env bash | |
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda | |
# and can be used for developing/testing Python 3.6 Lambda functions | |
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python | |
# This is required because Amazon Linux does not come with Python 3.6 pre-installed | |
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime | |
# The script has been tested successfully on a EC2 instance | |
# running 4.9.75-1.56.amzn2.x86_64 |
This file contains 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: (() => { | |
const copyToClipboard = text => { | |
const copyListener = event => { | |
document.removeEventListener('copy', copyListener, true); | |
event.preventDefault(); | |
event.clipboardData.clearData(); | |
event.clipboardData.setData('text/plain', text); | |
}; | |
document.addEventListener('copy', copyListener, true); | |
const result = document.execCommand('copy'); |
This file contains 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 | |
set -eu | |
# Change this as you want | |
PROFILE=default | |
# Check user ARN of the profile | |
USER_ARN=$(aws --profile $PROFILE sts get-caller-identity --query 'Arn' --output text) | |
echo "User ARN: '$USER_ARN'" |
This file contains 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
local machine=dev | |
local state=`docker-machine ls | grep $machine | awk '{ print $4 }'` | |
# Start machine if not running | |
if [[ "$state" != "Running" ]]; then | |
echo "Machine \"$machine\" is not running. Starting..." | |
docker-machine start $machine | |
docker-compose up -d | |
fi |
This file contains 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
package main | |
import ( | |
"sync" | |
"github.com/k0kubun/pp" | |
) | |
func main() { | |
m := map[int]string{} |
This file contains 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
FROM google/golang | |
RUN apt-get update -y && \ | |
apt-get install -y ca-certificates git-core ssh | |
ADD id_rsa /root/.ssh/id_rsa | |
RUN chmod 400 /root/.ssh/id_rsa | |
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config | |
RUN git config --global url.ssh://git@github.com/.insteadOf https://github.com/ |
This file contains 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
/Users/soshi/.rbenv/versions/2.1.5/bin/ruby extconf.rb | |
checking for rb_thread_blocking_region()... yes | |
checking for rb_thread_call_without_gvl()... yes | |
checking for rb_thread_alone()... yes | |
checking for rb_str_set_len()... yes | |
checking for clock_gettime() in -lrt... no | |
checking for sys/select.h... yes | |
checking for poll.h... yes | |
checking for sys/epoll.h... no | |
checking for sys/event.h... yes |
This file contains 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
# check if `docker-machine` command exists | |
if command -v docker-machine > /dev/null; then | |
# fetch the first running machine name | |
local machine=$(docker-machine ls | grep "Running" | head -n 1 | awk '{ print $1 }') | |
if [ "$machine" != "" ]; then | |
eval "$(docker-machine env $machine)" | |
fi | |
fi |
This file contains 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 | |
#========================================= | |
# Script for storing and restoring cache | |
# in Java / Scala project on werkcer | |
#========================================= | |
# cache directories | |
CACHES=( "ivy2" "sbt" ) | |
CMD="$1" |
This file contains 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 | |
DATABASE="$1" | |
TABLE="$2" | |
mysqldump | |
--user=username \ | |
--password=password \ | |
--complete-insert \ | |
--quick \ |
NewerOlder