Skip to content

Instantly share code, notes, and snippets.

@kencoba
kencoba / tohtml.rb
Created June 1, 2017 09:58
Listing video files.
#! /bin/sh
exec ruby -S -x "$0" "$@"
#! ruby
BEGIN {
puts <<-EOS
<!DOCTYPE html>
<html>
<head>
<meta charset=\"UTF-8\">
</head>
@kencoba
kencoba / Add-Type_for_PowerPoint.ps1
Created May 15, 2017 05:52
Add-Type_for_PowerPoint.ps1
Add-Type -AssemblyName Microsoft.Office.Interop.PowerPoint
[int][Microsoft.Office.Core.MsoAutoShapeType]::msoShapeCloud
@kencoba
kencoba / Points.ps1
Created May 15, 2017 05:50
This is for control PowerPoint with PowerShell.
Class Points {
[double] $Left
[double] $Top
[double] $Width
[double] $Height
[Points] Magnify([double] $percent) {
$center_X = $this.Left + ($this.Width / 2)
$center_Y = $this.Top + ($this.Height /2)
$newWidth = $this.Width * $percent
@kencoba
kencoba / Markdown_AddHeaderNumber.awk
Last active May 12, 2017 04:38
Add header number to markdown file.
# Markdown_AddHeaderNumber
# input: Markdown.md
# output: Markdown.md added number on headers
#
# header format
#
# ```Markdown
# # 1. header
# ## 1.1. header
# ```
@kencoba
kencoba / ListUtils.java
Created May 5, 2017 05:28
A partition method.
import java.util.ArrayList;
import java.util.List;
public class ListUtils {
public static <T> List<List<T>> partition(
List<T> list,
int size) {
if (list == null) { throw new NullPointerException("List must not be null.");}
if (size <= 0) { throw new IllegalArgumentException("Size must be greater than 0.");}
@kencoba
kencoba / ConfigProducer.java
Created March 25, 2017 04:52
LocalDate injection with Producer method. this is useful for unit test.
package producer;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Properties;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
@kencoba
kencoba / tt.clj
Last active November 15, 2016 06:01
(ns tt.core)
(def *min-level* 2)
(def *chars* "fjdksla;vmc,x.z/rueiwoqpghbnty4738291056:\\@-][^!\"#$%&'()=~|`{+*}<>?_")
(def *vals* (to-array (seq *chars*)))
(defn interval []
(let [start-time (System/currentTimeMillis)]
@kencoba
kencoba / keymap.c
Last active November 30, 2016 03:59
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#define BASE 0 // default layer
#define SYMB 1 // symbols
#define MDIA 2 // media keys
#define EPRM M(1) // Macro 1: Reset EEPROM
#!/bin/bash
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install vim emacs -y
sudo apt-get install apache2 -y
sudo apt-get install mysql-server -y
sudo apt-get install php -y
sudo apt-get install libapache2-mod-php -y
sudo apt-get install php-curl php-mysql php-xml php-xmlrpc php-gd php-intl php-zip php-mbstring php-soap -y
@kencoba
kencoba / art1.lisp
Created April 1, 2016 06:24
Generative Art1
(in-package :vecto)
(defun ball (ratio)
(set-line-width 1)
(dotimes (i 5000)
(set-rgba-stroke 0 0 (random 1) 0.05)
(with-graphics-state
(rotate (* i (random 10)))
(translate (- (random 40) 20) (- (random 20) 10))