Skip to content

Instantly share code, notes, and snippets.

@higepon
higepon / seq2seq.py
Last active August 1, 2023 09:05
Minimum Seq2Seq implementation using Tensorflow 1.4/1.5 API
import numpy as np
import tensorflow as tf
from tensorflow.python.layers import core as layers_core
hparams = tf.contrib.training.HParams(
batch_size=3,
encoder_length=4,
decoder_length=5,
num_units=6,
src_vocab_size=7,
@higepon
higepon / API.swift
Last active July 31, 2023 16:00
An example of JSON API call in Swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
@higepon
higepon / gist:b4a0be68c6185c5f31e03b50d3339a4d
Created July 15, 2019 08:17
user css for kibela to hide some headers
.noteHeader-author { display: none }
.noteActionBar { display: none }
.noteHeader-groups { display: none }
.noteHeader-titleFooter { display: none }
.noteHeader-title {font-size: 20pt }
Requirement already satisfied: easy-tf-log[tf] from git+https://github.com/mrahtz/easy-tf-log#egg=easy-tf-log[tf] in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: tensorflow in /usr/local/lib/python3.6/dist-packages (from easy-tf-log[tf])
Requirement already satisfied: protobuf>=3.4.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow->easy-tf-log[tf])
Requirement already satisfie
@higepon
higepon / mige.json
Last active December 14, 2015 21:09
{
"Twitter": "twitter://post?message=",
"directions to Twitter": "comgooglemaps://?saddr=&daddr=Suite+900:+1355+Market+St:+San+Francisco:+CA&directionsmode=transit",
"Twitter": "twitter://post?message=",
"Facebook": "fb://publish/?text=",
"home": "twitter://timeline",
"connect": "twitter://mentions",
"Gmail": "googlegmail://co?subject=&body=&to=higepon@gmail.com",
"camera": "camplus://",
"Foursquare": "foursquare://",
@higepon
higepon / ack
Created December 26, 2012 05:58
Use ack from Emacs. Wand to remove the last "interactive". Any suggestions?
(defun ack (directory keyword)
(setq default-directory (if (string= "dired-mode" major-mode)
(dired-current-directory)
(file-name-directory (buffer-file-name (current-buffer)))))
(interactive "D:What directory? \ns:keyword? ")
(grep-apply-setting 'grep-find-command (format "ack --nocolor --nogroup %s %s" keyword directory))
(call-interactively 'grep-find))
@higepon
higepon / gist:1574075
Last active September 29, 2015 08:28
brew install -v cdrtools
==> Downloading ftp://ftp.berlios.de/pub/cdrecord/cdrtools-3.00.tar.gz
File already downloaded in /Users/taro/Library/Caches/Homebrew
/usr/bin/tar xf /Users/taro/Library/Caches/Homebrew/cdrtools-3.00.tar.gz
==> smake INS_BASE=/usr/local/Cellar/cdrtools/3.00 INS_RBASE=/usr/local/Cellar/cdrtools/3.00 install
smake INS_BASE=/usr/local/Cellar/cdrtools/3.00 INS_RBASE=/usr/local/Cellar/cdrtools/3.00 install
==> Exit Status: 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/cdrtools.rb#L11
==> Environment k
HOMEBREW_VERSION: 0.8.1
HEAD: bcdce506a4eac512a258e2dc85bfa133623100ca
// ==UserScript==
// @name fill library form
// @match https://www.meguro-library.jp/opw/OPW/OPWBOOK.CSP*
// ==/UserScript==
document.forms[0].usercardid.value = 'YOUR_ID';
document.forms[0].password.value = 'YOUR_PASSWORD';
document.forms[0].library.value = 3; // 3 == nakameguro ekimae
@higepon
higepon / gist:740064
Created December 14, 2010 06:13
クラス名が文字列
(define-class <window> ()
(;; Pointer to the parent window.
(parent :init-keyword :parent :init-form *root-window*)
;; Sizes of the window
(width :init-keyword :width :init-value 1)
(height :init-keyword :height :init-value 1)
;; Position of the window relative to the parent.
(x :init-keyword :x :init-value 0)
(y :init-keyword :y :init-value 0)
))
;; 第1回 Scheme コードバトン
;;
;; ■ これは何か?
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。
;; 次回 Shibuya.lisp で成果を発表します。
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。
;;
;; ■ 2 つのルール
;;
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。