Skip to content

Instantly share code, notes, and snippets.

View techno-tanoC's full-sized avatar
💻

techno-tanoC techno-tanoC

💻
View GitHub Profile
{-# START_FILE package.yaml #-}
name: {{name}}
version: 0.1.0.0
#synopsis:
#description:
homepage: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}#readme
license: BSD3
author: {{author-name}}{{^author-name}}Author name here{{/author-name}}
maintainer: {{author-email}}{{^author-email}}example@example.com{{/author-email}}
copyright: {{year}}{{^year}}2017{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}}
PRE_IFS=$IFS
IFS=$'\n'
path=$1
directories=$(find "$path" -maxdepth 1 -mindepth 1 -type d)
files=$(find "$path" -maxdepth 1 -mindepth 1 -type f)
for f in $files; do
fn=$(basename "$f")
for d in $directories; do
require 'fileutils'
def blobs(path)
Dir.glob(path)
end
def files(files)
files.select {|f| File.file?(f) }
end
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux-gnu/libgcc_s.so.1
@techno-tanoC
techno-tanoC / encode.rb
Last active March 8, 2018 13:16
faststart付きでエンコード
names = Dir.entries("source") - [".", ".."]
names.each do |name|
base = File.basename(name, ".*")
p `ffmpeg -i "source/#{name}" -strict -2 -movflags +faststart "output/#{base}.mp4"`
end
module RSpecHelper
def leads
if block_given?
subject
expect(yield)
else
expect { subject }
end
end
end
@techno-tanoC
techno-tanoC / logical-normal-form.hs
Last active February 19, 2017 15:05
論理式を論理和標準形や論理積標準形にするやつ
module Main where
data Exp = Var String
| And Exp Exp
| Or Exp Exp
| Imp Exp Exp
| Not Exp
deriving Eq
instance Show Exp where
@techno-tanoC
techno-tanoC / gif.sh
Last active August 14, 2016 10:04
gifの作り方メモ
player -ao null input.mp4 -vo jpeg:outdier=out -ss 00:00:00 -fps 20
convert -resize 50% out/*.jpg %03d.jpg
# OptimizeFrame, OptimizeTransparency
convert -delay 5 -layers Optimize -fuzz 10% *.jpg output.gif
defmodule Progress do
def start_link name do
{:ok, file} = File.open name, [:write]
spawn_link(fn -> loop(file, 0, 0) end)
end
def loop file, size, total do
receive do
%HTTPoison.AsyncChunk{chunk: chunk} ->
IO.inspect {size, total}
#include <cstdio>
#include <iostream>
#include <cstring>
#include <time.h>
#include <stdio.h>
#define FILE_HEADER_SIZE 14
#define INFO_HEADER_SIZE 40
#define NOTE_PAD_WIDTH 315;