Skip to content

Instantly share code, notes, and snippets.

@AknEp
AknEp / ShadowedButton.swift
Created June 10, 2016 10:29
影つきの UIButton のサブクラスです。
class ShadowedButton : UIButton {
override func willMoveToSuperview(newSuperview: UIView?) {
super.willMoveToSuperview(newSuperview)
self.addTarget(self, action: #selector(addShadow), forControlEvents: UIControlEvents.TouchDown)
self.addTarget(self, action: #selector(addShadow), forControlEvents: UIControlEvents.TouchDragEnter)
self.addTarget(self, action: #selector(removeShadow), forControlEvents: UIControlEvents.TouchDragExit)
self.addTarget(self, action: #selector(removeShadow), forControlEvents: UIControlEvents.TouchUpInside)
}
@AknEp
AknEp / money_forward_pending_credits.user.js
Last active May 13, 2016 18:37
MoneyForwardのトップページでクレカの未確定残高もチェックできるやつ
// ==UserScript==
// @name MoneyForwardでクレカの未確定残高もチェック
// @namespace https://github.com/AknEp
// @version 0.2
// @description MoneyForwardのトップページ左上の総資産から、未確定のカード残高を引いて表示してくれるやつ。Tampermonkeyとか使えばインストールできるっぽいです。(Developed by: Twitter/GitHub @AknEp )
// @author AknEp
// @match https://moneyforward.com
// ==/UserScript==
(function(){
'use strict';
// How to integrate such two or more methods?
- (NSString *)string:(NSString*)string withoutMatches:(NSArray*)matches
{
NSMutableString *workString = [string mutableCopy];
// 逆順にしないと複数マッチの時に場所がずれる
[matches enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(NSTextCheckingResult* match, NSUInteger idx, BOOL *stop) {
[workString deleteCharactersInRange:match.range];
}];
remove all of your passwords in the LastPass.
$('.leaf.search').each(function(index,that){ d($(that).attr('id')); $('#ext-gen148').click() })
@AknEp
AknEp / PIUtilities.h
Created May 1, 2013 05:42
Photoshop CS6 SDK を XCode4.6.1 でビルドする ref: http://qiita.com/items/c6bd60b6f5a2d8b64552
inline Boolean PISetRect(Rect* pRect, short nLeft, short nTop, short nRight, short nBottom)
{
pRect->left = nLeft;
pRect->top = nTop;
pRect->right = nRight;
pRect->bottom = nBottom;
return true;
}
@AknEp
AknEp / file0.txt
Created April 17, 2013 03:37
Redmine2.3.0をサブディレクトリで動かす(Ruby2.0版) ref: http://qiita.com/items/459b08b63d0822caa7e4
$ cd your-web-document-root
$ ln -s /usr/share/redmine-2.3.0 redmine
@AknEp
AknEp / yes_or_no.rb
Created October 20, 2012 12:01
Check the input is "y" or "n", or not.
loop do
answer = gets.chomp
if answer == "y"
puts "You choose yes. See you."
break;
elsif answer == "n"
puts "You choose no. See you."
break;
else
puts "You typed #{answer} , you must type y or n."