Skip to content

Instantly share code, notes, and snippets.

@stealthinu
stealthinu / onnx2tf_test.py
Last active March 17, 2023 10:17
onnx2tf randn_like issue test
import torch
class OnnxTestRandnLike(torch.nn.Module):
def forward(self, x):
m = torch.randn_like(x)
y = m * x
return y
class OnnxTestRandn(torch.nn.Module):
def forward(self, x):
@stealthinu
stealthinu / soft-vc-test.ipynb
Created October 17, 2022 07:28
soft-vc-test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stealthinu
stealthinu / test.rb
Last active June 24, 2019 08:22
mailparser sample 1
# -*- coding: utf-8 -*-
require 'mailparser'
f = File.open("test.txt")
@raw = f.read
m = MailParser::Message.new(@raw, :decode_mime_header=>true)
body = ""
if m.multipart? then
@boundary = m.header["content-type"][0].params["boundary"]
@stealthinu
stealthinu / reveal.css
Last active September 21, 2018 08:33
reveal.cssへの追加設定。元のreveal.css→reveal.orig.cssへリネームしてimportする。
@import url('reveal.orig.css');
.reveal .slides h1,
.reveal .slides h2,
.reveal .slides h3,
.reveal .slides h4,
.reveal .slides h5,
.reveal .slides h6 {
-webkit-hyphens: auto;
-moz-hyphens: auto;
@stealthinu
stealthinu / gist:0e57c3a9c3b243afb524
Created December 2, 2015 06:47
mobaxtermのlocal terminalでうまく動かないscript
#!/bin/sh
DIR="/bin"
"$DIR/ls"
@stealthinu
stealthinu / BootstrapFormHelper_radio.patch
Created June 27, 2013 08:20
BootstrapFormHelperのradioボタンをボタンごとにinline指定出来るようにするパッチ
diff --git a/View/Helper/BootstrapFormHelper.php b/View/Helper/BootstrapFormHelper.php
index 89f9814..714709f 100644
--- a/View/Helper/BootstrapFormHelper.php
+++ b/View/Helper/BootstrapFormHelper.php
@@ -114,10 +114,19 @@ class BootstrapFormHelper extends FormHelper {
}
public function radio($fieldName, $radioOptions = array(), $options = array()) {
+ $inlineFlag = false;
+ if (isset($options['inline']) and true == $options['inline']) {
@stealthinu
stealthinu / makecake.sh
Last active December 17, 2015 12:29
make my CakePHP with no using Inflector submoduled CakePHP (easy to update) plugins: DebugKit/TwigView/TwitterBootstrap/Search
#!/bin/bash
if [ $# -ne 0 ]; then
project_name=${1}
else
echo "usage: makecake.sh [project_name]"
exit
fi
if [ -e ${project_name} ]; then