Skip to content

Instantly share code, notes, and snippets.

macneko-ayu

Block or report user

Report or block macneko-ayu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@macneko-ayu
macneko-ayu / hideTableViewCellSeparator.swift
Created May 8, 2019
UITableViewCellのsubviewsを走査してセパレーターを非表示にするやつ
View hideTableViewCellSeparator.swift
// 参考:https://stackoverflow.com/questions/29006311/grouped-uitableview-remove-outer-separator-line
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.subviews.forEach { subview in
if subview != cell.contentView, subview.frame.width == cell.frame.width, subview.frame.height == 0.5 {
// 特定のセクション、かつ特定のクラスだけ処理を変える場合
if indexPath.section == 99,
let cell = cell as? SampleTableViewCell {
// TODO: なにかする
} else {
subview.isHidden = true
@macneko-ayu
macneko-ayu / Playground.swift
Last active Feb 14, 2019
UILabelの文字列に線をつけて袋文字にするextension
View Playground.swift
// Please, paste the code in playground and execute it.
import UIKit
extension UILabel{
/// makeOutLine
///
/// - Parameters:
/// - strokeWidth: 線の太さ。負数
@macneko-ayu
macneko-ayu / create-font-sample.jsx
Last active Dec 1, 2018
Extendscript for creating font samples in Indesign
View create-font-sample.jsx
// sample movie: https://user-images.githubusercontent.com/5406126/49324964-f631aa80-f57c-11e8-9199-0ab51231422c.gif
main();
function main() {
// 関数定義
function applyFontToStory(targetFont) {
@macneko-ayu
macneko-ayu / ViewController.swift
Last active Sep 9, 2018
「iOSでチラシっぽい価格レイアウトを再現してみた」のコード
View ViewController.swift
//
// ViewController.swift
// Price
//
// Created by macneko on 2018/09/07.
// Copyright © 2018年 macneko. All rights reserved.
//
import UIKit
@macneko-ayu
macneko-ayu / illustrator-cmyk-plate-changer.jsx
Created Jul 29, 2018
Illustratorで選択しているオブジェクトのCMYK値を入れ替えるExtendScript
View illustrator-cmyk-plate-changer.jsx
var palette = new Window('palette', 'colorChanger');
var lists = [], buttons = [];
(function () {
var titles = ['塗り:', '線 :'];
var selectListItems = ['変更しない', 'シアン←→マゼンタ', 'シアン←→イエロー', 'マゼンタ←→イエロー'];
var buttonTitles = ['キャンセル', 'OK'];
palette.add('staticText', undefined, 'CMYK版を入れ替えるJavaScript');
var listContainer = palette.add('group', undefined);
listContainer.alignChildren = ['fill', 'center'];
@macneko-ayu
macneko-ayu / private.xml
Created May 22, 2018 — forked from kickbase/private.xml
Karabiner private.xml for Emacs, Vim, VSCode, Unity, Houdini.
View private.xml
<?xml version="1.0"?>
<root>
<appdef>
<appname>TERMINAL</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<appdef>
<appname>ITERM2</appname>
<equal>com.googlecode.iterm2</equal>
</appdef>
@macneko-ayu
macneko-ayu / InterfaceController.swift
Last active Mar 22, 2018
WKInterfaceLabel to automatically scroll horizontally
View InterfaceController.swift
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
@IBOutlet var notEndlessLabel: WKInterfaceLabel!
@IBOutlet var endlessLabel: WKInterfaceLabel!
override func awake(withContext context: Any?) {
super.awake(withContext: context)
@macneko-ayu
macneko-ayu / UIAlertControllerExtension.swift
Last active Nov 10, 2017
Sample calling a delegate method like UIAlertView when UIAlertController's UIAlertAction is executed. Available with Swift and Objective-C.
View UIAlertControllerExtension.swift
import UIKit
@objc protocol AlertControllerDelegate: class {
func alertController(_ alert: UIAlertController, tappedIndex: Int) -> Void
}
private var DelegateKey: UInt8 = 0
private var TagKey: UInt8 = 0
extension UIAlertController {
View UINavigationBar+Height.swift
import Foundation
private var AssociatedObjectHandle: UInt8 = 0
extension UINavigationBar {
var height: CGFloat {
get {
if let h = objc_getAssociatedObject(self, &AssociatedObjectHandle) as? CGFloat {
@macneko-ayu
macneko-ayu / LayerObjectCount.jsx
Created Jan 30, 2016
Illustratorのレイヤーに配置されたオブジェクトの数を数えてファイルに書き出すJavaScript Raw
View LayerObjectCount.jsx
main();
function main() {
var str = layerObjectCount(app.activeDocument);
writeFile(str);
}
function layerObjectCount(docObj) {
var mergeStrings = "";
for (var i = 0, iLen = docObj.layers.length; i < iLen ; i++) {
You can’t perform that action at this time.