Skip to content

Instantly share code, notes, and snippets.

View 44uk's full-sized avatar
♨️
ズイ₍₍(ง˘ω˘)ว⁾⁾ズイ

Yoshiyuki IEYAMA 44uk

♨️
ズイ₍₍(ง˘ω˘)ว⁾⁾ズイ
View GitHub Profile
## Example)
# ruby profile_generator.rb \
# -n TEST_NET \
# -b ./data/peer-node-0/00000/00001.dat \
# -u http://host.test:3000 \
# build/generated-addresses/addresses.yaml \
# > .nem2rc.json
require 'yaml'
require 'json'
require 'optparse'
@44uk
44uk / get_all_nem_namespace.sh
Created September 23, 2018 13:38
Get all nem namespace from Node
#!/bin/bash
nodeUrl=http://88.99.192.82:7890 # huge alice
# nodeUrl=http://176.9.68.110:7890 # huge alice 2
# nodeUrl=http://176.9.20.180:7890 # huge alice 3
tempDir=/tmp/_get_all_nem_namespace
lastId=99999
[ -d $tempDir ] || mkdir -p $tempDir
while [ "$lastId" != "null" ]; do
result=$(curl -s "$nodeUrl/namespace/root/page?pageSize=100&id=$lastId")
firstId=$(echo $result | jq .data[0].meta.id)
@44uk
44uk / nem2-cli-bash-completion
Last active February 1, 2019 02:03
nem2-cli-bash-completion
###-begin-nem2-cli-bash-completion-###
#
# nem2-cli completion script
#
# Installation: cat nem2-cli-bash-completion >> ~/.bashrc
# Or, maybe: mv nem2-cli-bash-completion /etc/bash_completion.d/nem2-cli
#
_nem2-cli-completion() {
local opts curr prev
curr="${COMP_WORDS[COMP_CWORD]}"

問題1. 選択肢の中からRubyの予約語ではないものを2つ選択してください。

  • A.super
  • B.begin
  • C.try
  • D.goto

問題2. 以下のコードを実行した出力として正しいものを1つ選択してください。

def foo (a, *b)
 p a
<html>
<head>
<script src="verify.js"></script>
</head>
<body>
<img src="http://dummyimage.com/300x800" />
</body>
</html>
#!/bin/sh -x
PREFIX=/opt/mecab
MECAB=mecab-0.996
IPADIC=mecab-ipadic-2.7.0-20070801
JUMANDIC=mecab-jumandic-7.0-20130310
NAISTDIC=mecab-naist-jdic-0.6.3b-20111013
[[ ! -e $MECAB.tar.gz ]] && wget https://mecab.googlecode.com/files/$MECAB.tar.gz
# [[ ! -e $IPADIC.tar.gz ]] && wget https://mecab.googlecode.com/files/$IPADIC.tar.gz
var props = {
divisibility: '0',
initialSupply: '21000000',
supplyMutable: 'true',
transferable: 'true'
}
// no need parse prop value
props.reduce(function (obj, el) { obj[el.name] = el.value; return obj }, {})
@44uk
44uk / nem_cheatsheet.md
Last active August 31, 2018 08:22
nem cheatsheet

nem cheatsheet

Type

Code Desc
1 The result is a validation result.
2 The result is a heart beat result.
4 The result indicates a status.
@44uk
44uk / Dockerfile
Last active January 7, 2018 08:19
Dockerfile for koto minerd
FROM alpine:latest
MAINTAINER Yoshiyuki Ieyama <44uk@github.com>
ENV SRCURL=https://github.com/koto-dev/cpuminer-yescrypt/archive/master.tar.gz
RUN apk add --update --no-cache automake autoconf gawk build-base curl curl-dev gcc tar make \
&& mkdir __workdir && cd $_ \
&& curl -kL $SRCURL | tar xz --strip=1 \
&& ./autogen.sh \
&& ./configure CFLAGS="-O3 -march=native -funroll-loops -fomit-frame-pointer" \
&& make && make install && make clean \
&& cd ../ && rm -rf __workdir
@44uk
44uk / Dockerfile
Last active January 7, 2018 12:01
Dockerfile for bitzeny minerd
FROM alpine:latest
MAINTAINER Yoshiyuki Ieyama <44uk@github.com>
ENV SRCURL=https://github.com/bitzeny/cpuminer/archive/master.tar.gz
RUN apk add --update --no-cache automake autoconf gawk build-base curl curl-dev gcc tar make \
&& mkdir __workdir && cd $_ \
&& curl -kL $SRCURL | tar xz --strip=1 \
&& ./autogen.sh \
&& ./configure CFLAGS="-O3 -march=native -funroll-loops -fomit-frame-pointer" \
&& make && make install && make clean \
&& cd ../ && rm -rf __workdir