Skip to content

Instantly share code, notes, and snippets.

View sign_binary_sparkle_appcenter.sh
#!/usr/bin/env bash
set -e
# sign.sh app release_id file
APP=$1
RELEASE_ID=$2
FILE=$3
SIGNATURE=$(./bin/sign_update ${FILE} | sed 's/[^"]*="\([^"]*\).*/\1/g')
@waynezhang
waynezhang / ac_distribute.sh
Created May 21, 2021
Upload binary to AppCenter.ms
View ac_distribute.sh
#!/bin/bash
set -e
# ac_distribute owner app file
# Original from https://gist.github.com/ouchadam/c74fa26c639a50d68bc35ee5749f868c
# Environment Variables created by App Center
# $APPCENTER_SOURCE_DIRECTORY
APPCENTER_OUTPUT_DIRECTORY=$(mktemp -d)
# $APPCENTER_BRANCH
View workspace2json.py
#! env python3
from lark import Lark
from lark import Transformer
import json
lark = Lark('''
?start: (macro | expr)*
?parameter: dict
View ViewController.swift
import Cocoa
class ViewController: NSViewController {
internal lazy var outlineView: NSOutlineView = {
let outlineView = NSOutlineView()
outlineView.usesAutomaticRowHeights = true
let column = NSTableColumn(identifier: .init(rawValue: "TestColumn"))
outlineView.addTableColumn(column)
View gist:52370b6ad99f6de77a54e97c220d7ebb
Pod::Spec.new do |s|
s.name = 'LicensePlist'
s.version = '1.8.3.1'
s.summary = 'A license list generator of all your dependencies for iOS applications'
s.homepage = 'https://github.com/waynezhang/LicensePlist'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = 'Masayuki Ono'
s.source = { :http => "#{s.homepage}/releases/download/#{s.version}/portable_licenseplist.zip" }
s.preserve_paths = '*'
s.exclude_files = '**/file.zip'
View gist:c93b8c7b6cde06320ce4966427d44a7f
map "ctrl+u" scrollPageUp
map "ctrl+d" scrollPageDown
set nosmoothscroll
@waynezhang
waynezhang / SaveCurrentURLToReminders
Last active Dec 18, 2015
Save Current URL To Reminders
View SaveCurrentURLToReminders
tell application "Safari"
set theTitle to name of current tab of front window
set theURL to URL of current tab of front window
end tell
tell application "Reminders"
tell default list
make new reminder with properties {name:theTitle, body:theURL}
end tell
end tell
@waynezhang
waynezhang / HibariRT
Created Jan 11, 2012
Quote RT for Hibari
View HibariRT
#!/usr/local/bin/jstalk
var application = [JSTalk application:'Hibari'];
var currentTweet = [application selectedTweet];
var controller = [application windowController];
[[controller composeArea] setStringValue:'RT: @' + currentTweet.screenName + ': ' + currentTweet.tweetText];
[controller newTweet];
@waynezhang
waynezhang / gist:1495626
Created Dec 19, 2011
Tag Cloud for Jekyll on Github Pages
View gist:1495626
<div id='tag_cloud'>
{% for tag in site.tags %}
<a href="#{{ tag[0] }}" title="{{ tag[0] }}" rel="{{ tag[1].size }}">{{ tag[0] }}</a>
{% endfor %}
</div>
<ul id='tag_list'>
{% for tag in site.tags %}
<li class='tag_item' id='{{ tag[0] }}'>
<span class='tag_name'>{{ tag[0] }}</span>
@waynezhang
waynezhang / gist:1205502
Created Sep 9, 2011
Add git tag info to Xcode build automatically
View gist:1205502
version=`git describe --tag`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" $PRODUCT_SETTINGS_PATH