Skip to content

Instantly share code, notes, and snippets.

@soy-curd
soy-curd / app.js
Created May 20, 2016 00:22
angular1x_typescript_snipet
var MyService = function (a, b) {
console.log(a);
return a + b;
};
var MyController = function ($scope, addService) { // 自動で名前解決する
$scope.message = "Hello world";
$scope.action = function ($event) {
if ($scope.message.indexOf("o") > 0) {
@soy-curd
soy-curd / endian.h
Created December 10, 2015 23:26 — forked from yinyin/endian.h
BSD/Linux-like <endian.h> for MacOS X
#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__
#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1
/** compatibility header for endian.h
* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents.
* It is public domain.
* */
#ifndef __APPLE__
@soy-curd
soy-curd / hatenaoauth_example_py3.py
Last active April 6, 2020 02:53 — forked from laiso/hatenaoauth_example.py
Pythonではてなの OAuth 対応 API を利用する(python3版)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。(settings.pyに保存してください)
$ python oauth_consumer.py
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。
+ 2015/10/25 python3用に書き換えました。
"""
@soy-curd
soy-curd / shuca_install.sh
Last active October 4, 2015 10:08
自動要約プログラムShucaのインストール手順
# md5sumのインストール(KNPのインストールに必要)
brew install md5sha1sum
# Juman(形態素解析器)のインストール
# (http://quruli.ivory.ne.jp/diary/?date=20120310)通りに。
mkdir juman
cd juman
curl -O http://nlp.ist.i.kyoto-u.ac.jp/nl-resource/juman/juman-7.01.tar.bz2
# curl等でパターンマッチしない
setopt nonomatch
# prompt
# LEFT
PROMPT='[%n]%'
# RIGHT
RPROMPT='[%d]'
@soy-curd
soy-curd / Suggest.scala
Created March 8, 2015 14:54
校正支援ツール
import java.net.URLEncoder.encode
import scala.io.Source
import scala.xml.{Elem, XML, PrettyPrinter}
object Suggest {
def main(args: Array[String]): Unit = {
val appid = args(0)
val sentence = args(1)
proof(appid, sentence)
}
import java.net.URLEncoder.encode
import scala.io.Source
import scala.xml.{Elem, XML, PrettyPrinter}
object Suggest {
def main(args: Array[String]): Unit = {
val appid = args(0)
val sentence = args(1)
proof(appid, sentence)
}