Skip to content

Instantly share code, notes, and snippets.

@yamakk
yamakk / mymecab.scala
Created December 6, 2011 11:56
mymecab.scala
import java.text.Normalizer
import scala.collection.mutable.ArrayBuffer
import org.chasen.mecab.{MeCab, Tagger, Node}
/*
scalac mymecab.scala
scala MyMeCabTest
ArrayBuffer(サイト, リンクフリー, リンクフリー)
@yamakk
yamakk / mygoogledocs.py
Created December 18, 2011 23:07
googledocsをcsvにエクスポート
#coding:utf-8
import gdata.docs.data
import gdata.docs.client
import gdata.docs.service
import gdata.spreadsheet.service
"""
SpreadSheetは
GoogleDocsからドキュメントをローカルにエクスポートするクラス
アカウント情報とdocumentのid, そしてexportしたいファイルの名前が必要
@yamakk
yamakk / 0_reuse_code.js
Created February 15, 2017 12:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yamakk
yamakk / nx2gt.py
Created March 25, 2021 23:32 — forked from bbengfort/nx2gt.py
Convert a networkx to graph-tool graph
import networkx as nx
import graph_tool as gt
def get_prop_type(value, key=None):
"""
Performs typing and value conversion for the graph_tool PropertyMap class.
If a key is provided, it also ensures the key is in a format that can be
@yamakk
yamakk / anki_shuffle_selection_template.html
Last active December 8, 2021 06:44
An anki template for shuffled choices - 文法の4択問題などは選択肢の並び順で正解を記憶してしまうことがあるため毎回選択肢をシャッフルできるAnkiテンプレート
<div class="ankiCard">
<div id="front-text" style="padding:15px; text-align:left;">{{Front}}</div>
<div id="hide" style="display:none;">
<div id="choices">{{choices}}</div>
</div>
<div id="selections" style="text-align:left; margin-left:10px;">
</div>
</div>
<script>
@yamakk
yamakk / App.swift
Last active August 12, 2022 17:30
Simplest MVVM with Combine
import Foundation
import SwiftUI
import Combine
struct API {
//private let url = URL(string: "https://hacker-news.firebaseio.com/v0/newstories.json")!
private let url = URL(string: "https://hacker-news.firebaseio.com/wrongendpoint")!
enum Error: LocalizedError, Identifiable {
var id: String { localizedDescription }
case addressUnreachable(URL)