Skip to content

Instantly share code, notes, and snippets.

@shogito
shogito / 3dWrapper.js
Last active December 5, 2018 08:12
JavascriptからCSS3のmatrixをいじる用関数達
// random関数定義
var random = function(_num){
return Math.floor(Math.random() * _num);
}
// range関数定義
var range = function(_start, _end, _step){
if (arguments.length <= 1){
_end = _start || 0;
_start = 0;
@shogito
shogito / piler.js
Created January 15, 2014 14:06
デッキ抽象化オブジェクト
function piler(_pile){
var _initPile = [].concat(_pile);
var _length = _pile.length;
var _maxIdx = _pile.length - 1;
var updateLength = function(){
_length = _pile.length;
_maxIdx = _pile.length - 1;
}
@shogito
shogito / bingo_demo.html
Created January 15, 2014 14:07
bingoデモ用html
<!DOCTYPE html5>
<html>
<head>
<meta charset="utf-8">
<LINK href="3dWrap.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../numeric.js"></script>
<script type="text/javascript" src="../3DWrap.js"></script>
<script type="text/javascript" src="../piler.js"></script>
<script type="text/javascript" src="init.js"></script>
@shogito
shogito / 3dWrap.css
Created January 15, 2014 14:08
bingoデモ用CSS
div {
transform-style: preserve-3d;
user-select: none;
-moz-transform-style: preserve-3d;
-moz-user-select: none;
-webkit-transform-style: preserve-3d;
-webkit-user-select: none;
}
.mainPanel {
@shogito
shogito / Bingo_init.js
Created January 15, 2014 14:09
bingoデモ用js
window.onload = function(){
bingo = piler(range(100));
bingo.shuffle();
bingo.createElement = function(parElm, fn){
var len = bingo.length();
var balls = {};
mainPanel = createMainPanel(parElm);
for (var _i = 0; _i < len; _i++){
@shogito
shogito / hook.rb
Last active June 28, 2016 08:47 — forked from tache/hook.rb
Hook for letsencrypt.sh to do DNS challenges
#!/usr/bin/env ruby
require 'aws-sdk'
require 'pry'
require 'awesome_print'
require 'domainatrix'
# ------------------------------------------------------------------------------
# Credentials
# ------------------------------------------------------------------------------
@shogito
shogito / hook-dns-01-lets-encrypt-route53.py
Created April 27, 2017 04:17
Python 3 script to use as a hook for the letsencrypt.sh client
#!/usr/bin/env python3
# How to use:
#
# LE_HOSTED_ZONE=XXXXXX LE_AWS_PROFILE=dns-access ./letsencrypt.sh --cron --domain example.org --challenge dns-01 --hook /tmp/hook-dns-01-lets-encrypt-route53.py
#
# More info about letsencrypt.sh: https://github.com/lukas2511/letsencrypt.sh/wiki/Examples-for-DNS-01-hooks
# Using AWS Profiles: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-multiple-profiles
# Obtaining your Hosted Zone ID from Route 53: http://docs.aws.amazon.com/cli/latest/reference/route53/list-hosted-zones-by-name.html
@shogito
shogito / turing_multi_thread.py
Last active December 25, 2018 11:56
rhinoでチューリングパターン - single thread
#!encoding: utf-8
import rhinoscriptsyntax as rs
import math as ma
import random
# 並列処理用ライブラリインポート
import threading
n=50
dt=0.5