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
import boto3 | |
from boto3.session import Session | |
import json | |
from datetime import datetime | |
import base64 | |
import gzip | |
import io | |
import time | |
my_stream_name = 'kinesis-stream-name' |
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
FROM centos:centos7.1.1503 | |
MAINTAINER tky | |
RUN yum swap -y fakesystemd systemd | |
RUN rpm --rebuilddb; yum install -y httpd | |
RUN echo "Hello apache" > /var/www/html/index.html | |
RUN systemctl enable httpd | |
EXPOSE 80 |
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
awk -v inputs="$1" -F'\t' ' | |
function join(array, start, end, sep, result, i) | |
{ | |
if (sep == "") | |
sep = " " | |
else if (sep == SUBSEP) # magic value | |
sep = "" | |
result = array[start] | |
for (i = start + 1; i <= end; i++) | |
result = result sep array[i] |
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
import System.Random | |
data Hand = Goo | Choki | Pa deriving (Show, Eq, Read) | |
data Result = Win | Lose | Draw deriving (Show, Eq) | |
data Record = Record { win :: Int, lose ::Int } deriving (Show) | |
record :: Record -> Result -> Record | |
record hs Win = Record { win = win hs + 1, lose = lose hs } | |
record hs Lose = Record { win = win hs , lose = lose hs + 1 } |
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 std::rand::Rng; | |
use std::rand; | |
use std::io; | |
#[deriving(PartialEq)] | |
enum Arrow { | |
RIGHT, LEFT, TOP, BOTTOM | |
} | |
impl Arrow { |
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 | |
#$ cat tmp.ltsv | |
#a:1 b:2 | |
#a:2 b:3 c:4 | |
#$ cat tmp.ltsv | ./filter.sh a | |
#1 | |
#2 | |
awk -v target="$1" -F'\t' '{ | |
for (i = 1; i <= NF; i++) { | |
pos = index($i, ":") |
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
package main | |
import ( | |
"encoding/json" | |
"os" | |
"bufio" | |
"strings" | |
"container/list" | |
"fmt" | |
"net/http" |
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 | |
FILE=$1 | |
cat $FILE | awk -F"\t" '{ | |
printf("{") | |
for (i = 1; i <= NF; i++) { | |
pos = index($i, ":") | |
key = substr($i, 0, pos - 1) | |
value = substr($i, pos + 1, length($i)) | |
if (value ~ /[0-9]/) { |
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
package main | |
// $cat tmp.ltsv | |
// a:1 b:2 | |
// a:2 b:3 c:v | |
// $go run ltsv.go tmp.ltsv | |
// {"a":1,"b":2} | |
// {"a":2,"b":3, "c":"v"} | |
import ( | |
"encoding/json" |
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
############################ | |
##playframework | |
# | |
#play controller | |
snippet playcon | |
package ${1:package} | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.data._ |
NewerOlder