Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
from keras.models import Sequential
from keras.layers import Dense
import numpy
numpy.random.seed(7)
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# 因為不太懂這樣的用法,所以用下面的程式來實驗...
X = dataset[:,0:8]
Y = dataset[:,8]
var token = "a JWT token"
// ...
var req = URLRequest(url: URL(string: "\(api_uri)/auth/refresh")!)
req.httpMethod = "POST"
req.addValue("Authorizetion", forHTTPHeaderField: token)
URLSession.shared.rx.data(request: req)
.map{ try! JSONDecoder().decode(TokenResult.self, from: $0) }
@mosluce
mosluce / Dockerfile
Last active February 6, 2018 09:05
ssh keygen
FROM alpine
RUN apk add --no-cache openssh-client
ADD ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
VOLUME [ "/root/.ssh" ]
ENTRYPOINT [ "./entrypoint.sh" ]
@mosluce
mosluce / Dockerfile
Last active February 6, 2018 06:29
clone private repo
FROM alpine
RUN apk add --no-cache git openssh-client bash
# RUN ssh-keygen -q -f /root/.ssh/id_rsa -P ""
COPY ./ssh /root/.ssh
RUN git clone git@github.com:mosluce/some-private.git
pipeline:
release:
image: plugins/ecr
access_key: ${ACCESS_KEY}
secret_key: ${SECRET_KEY}
repo: ${ACCOUNT_ID}.dkr.ecr.us-west-1.amazonaws.com/klcc/klcc-api
registry: ${ACCOUNT_ID}.dkr.ecr.us-west-1.amazonaws.com
region: us-west-1
tags:
- latest
# build stage
FROM golang:alpine AS build-env
RUN apk add --no-cache git bzr gcc musl-dev
RUN mkdir -p /go/src/klcc/auth
WORKDIR /go/src/klcc/auth
COPY . .
RUN go get -u github.com/kardianos/govendor
@mosluce
mosluce / 123.js
Last active January 11, 2018 01:30 — forked from anonymous/123.js
console.log(1)
step1(x, function(value1){
console.log(2)
//do something...
step2(y, function(value2){
console.log(3)
//do something...
step3(z, function(value3){
//do something...
console.log(4)
FROM ubuntu:16.04
# Essential packages
RUN apt-get update
RUN apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-dev
RUN apt-get install -y libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev
RUN apt-get install -y automake libtool libffi-dev curl git tmux gettext
# Python
RUN apt-get install -y python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper
@mosluce
mosluce / serial.go
Created December 6, 2017 08:12
Serial port 列表 (USB、藍芽)...等
package main
import (
"bufio"
"fmt"
"os"
serial "go.bug.st/serial.v1"
)
//
// Layout.swift
// App
//
// Created by 默司 on 2017/12/1.
// Copyright © 2017年 GTS. All rights reserved.
//
import UIKit