Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
namespace Experiments.Networking {
public class Networking : Editor {
[MenuItem("Experiments/Send Request")]
public static async Task SendRequest() {
using System.Reflection;
using System.Threading;
using UnityEditor;
using UnityEngine;
public static class EditorAsyncPump {
[InitializeOnLoadMethod]
static void Initialize() {
Debug.Log("Pump Initialize");
EditorApplication.update += ExecuteContinuations;
#include <SPI.h>
#include <MFRC522.h> // 引用程式庫
#define RST_PIN A0 // 讀卡機的重置腳位
#define SS_PIN 10 // 晶片選擇腳位
#define BUZZ_PIN 8 // 蜂鳴器腳位
MFRC522 mfrc522(SS_PIN, RST_PIN); // 建立MFRC522物件
MFRC522::MIFARE_Key key; // 儲存金鑰
//
// Layout.swift
// App
//
// Created by 默司 on 2017/12/1.
// Copyright © 2017年 GTS. All rights reserved.
//
import UIKit
@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"
)
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 / 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)
# 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
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
@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