Skip to content

Instantly share code, notes, and snippets.

View utam0k's full-sized avatar
:octocat:
Hi!

Toru Komatsu utam0k

:octocat:
Hi!
View GitHub Profile
#!/bin/bash
set -e
scriptdir="$(cd "$(dirname "$0")"; pwd)"
script="${scriptdir%/}/$(basename "$0")"
readonly IMAGE_DIR="${HOME}/images/"
readonly CONTAINER_DIR="${HOME}/container/"
escape() {
@utam0k
utam0k / config.json
Created May 30, 2021 09:05
for youki tutorial
{
"ociVersion": "1.0.2-dev",
"process": {
"terminal": false,
"user": {
"uid": 0,
"gid": 0
},
"args": [
"sleep", "5"
@utam0k
utam0k / watch.sh
Created January 5, 2019 13:18
Automatic recompilation when writing to the files in a current directory.
#/bin/sh
# Require:
# $ sudo apt install inotify-tools
# Usage:
# $ chmod +x watch.sh
# $./watch.sh file.saty
while inotifywait -qre modify .
diff --git a/mkdir.c b/mkdir.c
index 6e4c954..f1a0a41 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -1,11 +1,13 @@
#include "types.h"
#include "stat.h"
+#include "date.h"
#include "user.h"
extern crate libc;
use std::thread;
use std::mem;
use std::cell::UnsafeCell;
use std::os::unix::io::RawFd;
use std::sync::mpsc::{RecvError, SendError};
use libc::{c_int, c_void, close, size_t};
use libc::pipe as c_pipe;
use libc::write as c_write;
@keywords = ['private','protected','public']
@keywords << ['void','int','float','double','char']
@keywords.flatten!
def extraction(file_name)
output = []
File.open(file_name) do |file|
file.each_line do |labmen|
labmen = labmen.encode("UTF-8", "UTF-8", :invalid => :replace, :undef => :replace, :replace => '?')
class_name = labmen[/class\s(\w+)/, 1]
# coding: utf-8
require 'twitter'
require 'date'
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/installed_app'
require 'google/api_client/auth/file_storage'
SEARCH_WORD = ARGV[0]
# -*- coding: utf-8 -*-
import time
import math
import cv2
import sys
import numpy as np
# 座標を管理するクラス
class Point:
@utam0k
utam0k / sample.py
Last active December 14, 2015 13:19
# -*- coding: utf-8 -*-
import time
import math
import cv2
import sys
import numpy as np
# 座標を管理するクラス
class Point:
import Prelude
import Data.Int
import Control.Parallel
-- 素数判定
isPrime :: Int32 -> Bool
isPrime x = all (\n -> x `mod` n /= 0) [ 2 .. toEnum (floor $ sqrt $ fromIntegral x) ]
-- 2から1000000までの数
arr :: [Int32]