Skip to content

Instantly share code, notes, and snippets.

View slack_change_status.sh
#!/bin/zsh
eval "$(cat .env <(echo) <(declare -x))"
curl \
-H 'Content-Type: application/json; charset=UTF-8' \
-H "Authorization: Bearer "${SLACK_USER_TOKEN} \
-X POST https://slack.com/api/users.profile.set \
-d '{ "profile": { "status_text": "'$1'", "status_emoji": "'$2'" }}' -vvv
View copyWin2WSL.sh
mkdir -p .ssh && cp /mnt/c/Users/axt/.ssh/* .ssh/ && chmod -R 600 .ssh/*
mkdir -p .sbt && cp /mnt/c/Users/axt/.sbt/sbt.repositories .sbt/
mkdir -p .sbt && cp /mnt/c/Users/axt/.sbt/.credentials .sbt/
mkdir -p .m2 && cp /mnt/c/Users/axt/.m2/settings.xml .m2/
View install_pocketsphinx.sh
#move to paticular folder...
if [[ $(uname -a) = *"Ubuntu"* ]]; then
#Ubuntuの場合
sudo apt-get install pocketsphinx
else
#macの場合
brew install cmu-pocketsphinx
fi
@axtstar
axtstar / opencv_build_with_contrib.sh
Last active Oct 23, 2021
opencv_contribのビルド shではなくbashでビルド
View opencv_build_with_contrib.sh
#move to paticular folder...
#Tesseractに必要なライブラリの導入
if [[ $(uname -a) = *"Ubuntu"* ]]; then
#Ubuntuの場合
sudo apt-get install libleptonica-dev
sudo apt install libpango1.0-dev
elif [[ $(uname -a) = *"Linux"* ]]; then
#WSLの場合
sudo apt-get install libleptonica-dev
View opencv_simple.py
# -*- coding: utf-8 -*-
import cv2
import argparse
#引数
parser = argparse.ArgumentParser(description='in:input file, out: Output file.')
parser.add_argument('-i','--input',
action='store',
nargs='?',
type=str,
View numToTime.pl
use strict;
use warnings;
use POSIX;
my $numStr = "";
my $length = @ARGV;
if ($length>0){
$numStr = $ARGV[0];
}
@axtstar
axtstar / timeToNum.pl
Created Jul 12, 2017
exchange time(00:00 expression) to number(minutes)
View timeToNum.pl
use strict;
use warnings;
my $timeStr = "";
my $length = @ARGV;
if ($length>0){
$timeStr = $ARGV[0];
}
else {
@axtstar
axtstar / show SHA-256
Last active Jun 9, 2017
make SHA-256 digest and BASE64 encode on scala
View show SHA-256
def getSha256MD(input:String) = {
val md = java.security.MessageDigest.getInstance("SHA-256")
val ha = new sun.misc.BASE64Encoder().encode(md.digest(input.getBytes))
ha
}
val input = "input"
getSha256MD(input)
View Jenkinsfile_Sample
node {
try {
stage ('git'){
checkout scm
}
stage ('build'){
//sh 'mvn clean package'
parallel 'maven build':{
sh 'echo test'
}, 'node build':{
View reversi_jquery.html
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
var passYou = false;
var passCom = false;
var myturn = 0;
var yourColor = 0;
var comColor = 1;
$(function(){