Skip to content

Instantly share code, notes, and snippets.

@adison
adison / outlineview.m
Last active January 14, 2022 06:14
make source list style nsoutlineview programmatically
NSScrollView* container = [[NSScrollView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
container.hasVerticalScroller = YES;
container.hasHorizontalScroller = YES;
container.wantsLayer = YES;
container.identifier = [@(LOGVIEW_OFFSET + i) stringValue];
NSClipView* clipview = [[NSClipView alloc] init];
clipview.autoresizesSubviews = YES;
clipview.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
@adison
adison / Midnight.dvtcolortheme
Created December 8, 2015 02:53
Xcode midnight theme with Source-Code-Pro font
<?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>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@adison
adison / Front-end-Developer-Interview-Questions-TC.md
Created November 19, 2015 15:46 — forked from hanksudo/Front-end-Developer-Interview-Questions-TC.md
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@adison
adison / CasksInstall.sh
Created November 5, 2015 16:19 — forked from visioncan/CasksInstall.sh
CasksInstall
#!/bin/bash
# install xcode command tool
xcode-select --install
# check
xcode-select -p
# install brew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@adison
adison / gist:feba5d7a4048951802d4
Created October 13, 2015 08:06 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@adison
adison / gist:47bf79fcc62685da3837
Created September 20, 2015 03:50
ios 常用 macro
//
// Macro.h
// mobile-life
//
// Created by Adison Wu on 14/2/14. // 情人節耶!!
// Copyright (c) 2013年 senao. All rights reserved.
// 固定用的一些 macro 方法,不牵涉 app 变数定义
// 取角度
#define degreesToRadian(x) (M_PI * (x) / 180.0)
@adison
adison / checksum.java
Last active August 29, 2015 14:28
java xor chemsum
import java.util.*;
import java.util.Random;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
class Untitled {
public static void main(String[] args) {
@adison
adison / gist:eea8c608112e175e45d9
Last active August 29, 2015 14:27
some useful bash alias for git
#!bash
# command for pretty log in x days, ex, for logs within 180 days: gitlog 180
gitlogfunction (){
git log --since=$1.days --date='local' --pretty=format:'%an %ad %s';
}
alias gitlog=gitlogfunction;
@adison
adison / remove_comments.py
Last active August 4, 2017 17:34
remove comments in sublime text
import sublime_plugin
import sublime
# code from http://stackoverflow.com/questions/26286879/can-we-make-use-of-syntax-highlighting-feature-to-remove-all-comments-from-a-sou
# how to use
# save as remove_commands in sublime text package/user folder,
# open foloder from [Preferences] > [Browser Packages], and you will find [User] folder
# save this file in [User] foler.
#
# after file saved, open command panel in sublime text, aka ctrl + `
@adison
adison / routineBackup.py
Created May 29, 2015 09:12
git python SAMBA bakcup script
import sys
import os
import git
from git import Repo
from time import gmtime, strftime
import time
# 這是用來
# 1. 讓 MCS, EC 端檢查檔案是否有更新,有更新則提交
# 2. 讓本地 repo 進行檢查,然後push到 bit 上