This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function timeAgoInWords($datetime, $now = null){ | |
if($now === null){ $now = date('Y-m-d H:i:s'); } | |
$units = array( | |
'y' => 31104000, | |
'm' => 2592000, | |
'd' => 86400, | |
'h' => 3600, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
if [ ! -x "`which wget`" ]; then | |
echo "Required wget." | |
exit 1 | |
fi | |
mkdir exams | |
# PDF の url 抽出 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var handler = null; | |
Shadowbox.init({ | |
onOpen: function() { | |
handler = setInterval(function() { | |
sbo = document.getElementById('sb-overlay') | |
if(sbo){ | |
sbo.style.height = window.innerHeight + "px"; | |
} | |
}, 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "you need to provide private key"; | |
exit 1 | |
fi | |
key=`echo $1 | sed 's/[0-9a-fA-F]*//'` | |
if [ -n "$key" ]; | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>[NEM] PrivateKey -> PublicKey, Address Converter</title> | |
<style> | |
h1 { | |
font-size: 0.95rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://www.tfx.co.jp/historical/fx/#anchor03 | |
# くりっく365 サマリデータ ダウンロード | |
# ペアと年度を指定したダウンロードを行います。 | |
PAIR=$1 | |
YEAR=$2 | |
[ -z $PAIR ] && echo 'currency PAIR required as first argument.' && exit 1 | |
[ -z $YEAR ] && echo 'from YEAR required as second argument.' && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://techbureau-api-document.readthedocs.io/ja/latest/trade/ | |
NONCE=$(date "+%s") | |
KEY=__YOUR_KEY__ | |
SECRET=__YOUR_SECRET__ | |
METHOD=get_info | |
PARAMS="nonce=$NONCE&method=$METHOD" | |
SIGN=$(echo -n $PARAMS | openssl dgst -hmac $SECRET -sha512 | sed 's/^.* //') | |
curl https://api.zaif.jp/tapi -H "Key: $KEY" -H "Sign: $SIGN" -d $PARAMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ex) | |
# curl -kL {raw_url} | sudo bash | |
# disable and unmount floppy device | |
bash -c "echo 'blacklist floppy' > /etc/modprobe.d/blacklist-floppy.conf" | |
rmmod floppy && update-initramfs -u | |
unlink /media/floppy && rmdir /media/floppy0 | |
# CapsLock => ctrl | |
grep 'XKBOPTIONS="ctrl:nocaps"' /etc/default/keyboard || echo 'XKBOPTIONS="ctrl:nocaps"' >> /etc/default/keyboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'webrick' | |
srv = WEBrick::HTTPServer.new( | |
:BindAddress => '127.0.0.1', # '0.0.0.0' allow remote access | |
:Port => (port = ARGV[0].to_i) === 0 ? 3000 : port, | |
:DocumentRoot => './', | |
:DoNotReverseLookup => true | |
) | |
trap(:INT){srv.shutdown} | |
srv.start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |