Skip to content

Instantly share code, notes, and snippets.

@ymt2
ymt2 / bitbar-px-m5041f.2m.py
Last active August 18, 2016 07:46
bitbar plugin for check EPSON PX-M5041F availability
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2016 ymt2 (Tatsuya Yamamoto)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
@ymt2
ymt2 / gtm-oauth.podspec.json
Last active June 27, 2016 10:14
podspec.json for install gtm-oauth:0.0.1
{
"name": "gtm-oauth",
"version": "0.0.1",
"summary": "Google Toolbox for Mac - OAuth Controllers.",
"homepage": "http://code.google.com/p/gtm-oauth",
"authors": "Google Inc.",
"source": {
"git": "https://github.com/google/gtm-oauth.git"
},
"frameworks": [
@ymt2
ymt2 / touch_reload_event_listener.py
Created June 16, 2016 18:15
Touch reload event listner for Supervisor
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals,
absolute_import, generators, division)
# The MIT License (MIT)
# Copyright (c) 2016 ymt2 (Tatsuya Yamamoto)
#
# Permission is hereby granted, free of charge, to any person obtaining
@ymt2
ymt2 / gist:9e60306ccfd8f57a1ffe
Last active August 29, 2015 14:19
Now playing on InterFM / InterFM で演奏中のやつ
curl https://www.interfm.co.jp/search/ |
/usr/bin/grep td |
tail -n 2 |
sed 's/.*<td[^>]*>\(.*\)<\/td>/\1/' |
python -c 'import sys, urllib; l = [x.strip() for x in sys.stdin.readlines()]; print " / ".join(l)'
@ymt2
ymt2 / decodeUnicode.js
Last active July 8, 2019 12:56
Decode unicode text for ClipMenu
// Decode unicode text for ClipMenu ( http://www.clipmenu.com/ja/ )
return (function(text) {
return text.replace(/\\[uU]([a-fA-F0-9]{4})/g, function(matchedString, group1) {
return String.fromCharCode(parseInt(group1, 16));
});
})(clipText);
#!/bin/sh
### a command line tool for make iOS Icons
## by Tatsuya Yamamoto <tatsuya@ymt2.net>
## Depends:
# ImageMagick
## Ref:
# http://blog.manbolo.com/2013/08/15/new-metrics-for-ios-7-app-icons
@ymt2
ymt2 / my.cnf
Last active December 20, 2015 02:49
既存の MySQL と共存して MySQL 5.6 を使うための my.cnf with MacPorts
# デフォルト設定は skip-networking なので使わない
# Use default MacPorts settings
# !include /opt/local/etc/mysql56/macports-default.cnf
[client]
port = 3306
# 既存の MySQL が見ている my.cnf を変更しておく:port = 3307
socket = /opt/local/var/run/mysql56/mysqld.sock
[mysql]
@ymt2
ymt2 / launch_image_optim.py
Last active December 17, 2015 22:49
[githook][python]Indexにステージされている.pngファイルをImageOptimにかける
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
IMAGE_OPTIM_APP_NAME = 'ImageOptim'
IMAGE_OPTIM_LAUNCH_OPTION = ['open', '-a', IMAGE_OPTIM_APP_NAME]
@ymt2
ymt2 / mysql5.wrapper
Created February 8, 2013 14:19
mysql5.wrapper
#!/bin/sh
#
# MacPorts generated daemondo support script
#
#
# Init
#
prefix=/opt/local
@ymt2
ymt2 / org.macports.mysql.plist
Created February 8, 2013 14:18
org.macports.mysql.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<false/>
<key>Label</key>
<string>org.macports.mysql5</string>
<key>OnDemand</key>
<false/>