Skip to content

Instantly share code, notes, and snippets.

@hackugyo
hackugyo / frame_background.xml
Created April 1, 2015 01:11
枠っぽいxml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 外枠 -->
<item android:top="0dp">
<shape>
<solid android:color="#999999" />
<corners android:radius="8dp" />
</shape>
</item>
<!-- 左上の影 -->
@hackugyo
hackugyo / ch11.md
Last active November 10, 2017 04:07
Williamson, 2000のch. 11を読んでいます

11. Assertion

  • Willliamson(2000), Knowledge and Its limits
  • 2015/05/27 担当:渡辺
  • 2015/07/24 sec. 3 担当:渡辺

  • この章前半で説明すべき直観:
@hackugyo
hackugyo / ag_regex_negative_lookahead.sh
Created June 16, 2015 03:14
bashの履歴展開が,agに渡したい正規表現の否定先読みと衝突する
# Bash history expansion expands "!***" to a command! So you must use ag with regex in a script like this sample.
# For example, $ag "^(?!.*sample).*$" returns "-bash: !.*sample: event not found"
echo "Please pick me"
echo "Please pick only me!"
echo "sample 1"
ag -G *.sh "^(?!.*sample).*$" #=> 3,4
echo "sample 2"
ag -G *.sh "^.*(?!.*sample).*$" #=> (all lines)
echo "sample 3"
ag -G *.sh "only(?!.*sample).+$" #=> 3
@hackugyo
hackugyo / hubot-amazon.coffee
Last active May 26, 2018 13:14
Amazon Product Advertising APIを使った、タイトルを食わせるとISBN (もしくはasin)を返すHubot。AWS関係のID/SECRETはここで登録して取得(電話で認証するので電話番号が必要) https://affiliate-program.amazon.com/gp/flex/advertising/api/sign-in-jp.html $ npm install amazon-product-api --saveしてからhubotのscripts配下に置いたら使えるはず。herokuの環境設定は $heroku config:set AMAZON_AWS_SECRET=YOUR_SECRET --app your-awesome-app-nam…
module.exports = (robot) ->
robot.hear /^get_isbn (.*)/i, (msg) ->
keyword = "#{msg.match[1]}"
amazon = require('amazon-product-api')
client = amazon.createClient({
awsId: process.env.AMAZON_AWS_ID,
awsSecret: process.env.AMAZON_AWS_SECRET,
awsTag: process.env.AMAZON_AWS_TAG,
})
client.itemSearch {
// Amazonの注文履歴をCSV形式にして出力するスクリプト
//
// 以下のスクリプトを参考に作成されました。
// http://moroya.hatenablog.jp/entry/2013/06/03/225935
//
// CSVに成型しているのは14行目から定義されているformatEntryという関数なので、これを書き換えれば自由な書式で出力できます。
(function(){
// 各注文履歴をCSVフォーマットにして返す
var datePattern = new RegExp("(\\d{4})年(\\d{1,2})月(\\d{1,2})日");

Unity without Identity: A New Look at Material Constitution

  • Baker, 1999
  • pdf

イントロ

AN ACCOUNT OF CONSTITUTION

注11

I am claiming, rather, that being a statue is an essential property of David, but not of Piece — even though being a statue is a relational property, in as much as whether or not something is a statue depends on its relation to an artworld or to an artist. I depart from the tradition in holding that not all essential properties are intrinsic.

@hackugyo
hackugyo / open_philpapers.sh
Last active August 29, 2015 14:24
哲学若手研究者フォーラム(2015)タイム文献表(非公認)
#!/bin/bash
set -e # stop when an error happens
open "http://philpapers.org/s/\"${@}\""
@hackugyo
hackugyo / Comment.java
Last active August 29, 2015 14:25
Gson does not go with instance initializers!
public class Comment {
public String author;
public String content;
public Comment(String author, String content) {
this.author = author;
this.content = content;
}
}
@hackugyo
hackugyo / gsearch.sh
Last active November 6, 2015 05:05
Google:未指定キーワードを発生させずに検索する
# usage:
# $ gsearch your query
# => Google '"your" "query"'
gsearch ()
{
( argv=("$@");
# arr=$(for v in "${argv[@]}"; do echo "$v"; done); \
arr=$(for v in "${argv[@]}"; do echo "\"$v\""; done);
str="$(IFS=" "; echo "${arr[*]}")";
open https://www.google.co.jp/search?q="$str" )
@hackugyo
hackugyo / package.json
Last active November 7, 2015 12:32
Trelloのカードを削除する
{
"name": "node-trello-deleter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"trello-deleter" : "./trello_deleter.coffee",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {