Skip to content

Instantly share code, notes, and snippets.

View tnoborio's full-sized avatar

Tokusei Noborio tnoborio

View GitHub Profile
(ns p2048.core)
(def size 4)
(defn empty-line []
(vec (replicate size 0)))
(defn gen-stage []
(vec (for [x (range size)]
(empty-line))))
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameSystem : MonoBehaviour
{
public Text text;
public int score = 0;
void Start()
@tnoborio
tnoborio / logo.ino
Created August 5, 2018 05:30
Display HaLake logo for M5Stack
#include <M5Stack.h>
static const uint16_t image_data_logo[57600] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xfff
#!/bin/bash
sudo yum update -y
sudo yum install gcc gcc-c++ libxml2-devel -y
wget http://jp2.php.net/get/php-7.2.4.tar.bz2/from/this/mirror -O php-7.2.4.tar.bz2
tar jxvf php-7.2.4.tar.bz2
mkdir -p php-lambda/php-bin
cd php-7.2.4
./configure --prefix=/home/ec2-user/php-lambda/php-bin/
make install
import boto3
import json
def lambda_handler(evt, context):
boto3.client('iot-data', region_name='ap-northeast-1').update_thing_shadow(
thingName = "bot",
payload=json.dumps({"state": {"desired": {"foo": 4}} })
)
(ns repeating-decimal)
(defn repeating-decimal [n]
(loop [rem 1 rems #{} divs [] i 0]
(let [div (int (/ (* rem 10) n))
rem (mod (* rem 10) n)]
(if (and (not= rem 0) (contains? rems rem))
[n divs]
(when (not= rem 0)
(recur rem (conj rems rem) (conj divs div) (inc i)))))))
(ns hoge.core
(:use [clojure.string :only [reverse]]))
(def app (js/Vue. (clj->js {:el "#app"
:data {:message "Hello Vue from ClojureScript!"}})))
;; (set! (.-message app) "new message")
(def app2 (js/Vue. (clj->js {:el "#app-2"
:data {:message (str "You loaded this page on " (js/Date.))}})))
@tnoborio
tnoborio / main.js
Last active February 5, 2017 06:47
'use strict'
const NodeWebcam = require( "node-webcam" ),
vision = require('google-cloud').vision,
notifier = require('node-notifier')
const visionClient = vision({
projectId: process.env.GCLOUD_PROJECT,
keyFilename: './keyfile.json'
})
#define pin_A 0
#define pin_B 14
#define pin_C 13
#define pin_D 12
#define pin_E 15
#define pin_F 16
#define pin_G 2
void setup() {
// put your setup code here, to run once: