Skip to content

Instantly share code, notes, and snippets.

View iketiunn's full-sized avatar

ike iketiunn

View GitHub Profile
@iketiunn
iketiunn / example.bash
Created April 7, 2022 01:57
pipe stdin json to beautify by evaluating script with node
# 1
echo "{a: 123, v: 546}" | xargs -I {} node -e "console.log(JSON.stringify({}, null, 2))"
# 2
cat some.json | xargs -I {} node -e "console.log(JSON.stringify({}, null, 2))"
@iketiunn
iketiunn / Dockerfile
Created August 17, 2020 14:48
Custom assets build
FROM golang:1.13-alpine as builder
LABEL maintainer="MinIO Inc <dev@min.io>"
ENV GOPATH /go
ENV CGO_ENABLED 0
ENV GO111MODULE on
COPY . ./minio
RUN cd minio && go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)"
@iketiunn
iketiunn / counter.ex
Created July 20, 2020 08:16
liveview example
defmodule HanxinWeb.CounterLive do
use HanxinWeb, :live_view
def mount(_params, _session, socket) do
{:ok, assign(socket, hello: :world, count: 0)}
end
def render(assigns) do
~L"""
<H1>Hello <%= assigns.hello %></H1>
@iketiunn
iketiunn / index.ts
Last active November 21, 2019 04:27
(TBD) spreadsheet api example
/**
* After aquired a service account's certfication with right permisstion with spreadsheet
*/
import { google } from "googleapis"; // npm i googleapis
const serviceAccount = require('service-account-cert.json')
const auth = new google.auth.JWT(
serviceAccount.client_email,
undefined,
serviceAccount.private_key,
"https://www.googleapis.com/auth/spreadsheets",
@iketiunn
iketiunn / tar.sh
Last active March 18, 2019 06:09
tar without vendor
tar -vczf targetName.tar --exclude=node_modules --exclude=.git --exclude=./vendor --exclude=./.sass-cache targetName
@iketiunn
iketiunn / node-npm.md
Last active September 21, 2017 10:06
Node and npm environment tips or snippets
// in app root
cd node_modules && ln -nsf ../ @app

// .gitignore
node_modules/*
!node_modules/@app

// *.js
// Before
@iketiunn
iketiunn / amazon.md
Last active September 21, 2017 10:00
Some amazon compute cloud tips

Increase volumes in amazon console

EC2 service -> ELASTIC BLOCK STORE -> Chose your volume -> Actions -> Modify Volume

Then wait the process compelete.

Resize file system on instance

ubuntu@ip-172-31-26-7:~$ lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 20G 0 disk
@iketiunn
iketiunn / genaral.sh
Last active September 11, 2018 03:26
bash-snippet / bash
# Redireact stdout to date-named file
λ echo '123' >> "$(date -d 'yesterday 01:00' '+%Y-%m-%d').log"
λ ls
2018-09-10.log
@iketiunn
iketiunn / zeromq-vs-redis.md
Created October 9, 2016 07:47 — forked from hmartiro/zeromq-vs-redis.md
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

@iketiunn
iketiunn / Lec1b.md
Last active August 9, 2016 03:03
SICP

Computational modle

substition modle

Linear Iteration time = O(n) space = O(1)

Linear Recursion time = O(x) space = O