Skip to content

Instantly share code, notes, and snippets.

View ty0x2333's full-sized avatar
🎯
Focusing

Tian Yiyan ty0x2333

🎯
Focusing
View GitHub Profile
@ty0x2333
ty0x2333 / SearchViewStyle.java
Created May 28, 2019 17:11 — forked from jaredrummler/SearchViewStyle.java
Customize the SearchView in an ActionBar for Android
/*
* Copyright (C) 2015 Jared Rummler <jared.rummler@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ty0x2333
ty0x2333 / stitching_images.py
Last active September 2, 2018 17:48
Stitching Images
# Python 3
# requirements:
# wand==0.4.1
from wand.image import Image
import os
from math import ceil, floor
NUMBER_OF_COL = 17
ITEM_WIDTH = 260
@ty0x2333
ty0x2333 / generate_ios_icons.sh
Last active June 19, 2018 05:39
generate ios / mac app icons
#!/bin/sh
SRC_FILE=$1
DST_PATH=$2
if [ -z "$DST_PATH" ]; then
DST_PATH=$(dirname $0)
fi
error() {
local red="\033[1;31m"
-- CLIDemo.scpt
--
-- https://gist.github.com/luckytianyiyan/5714014bb3622143c89a69dea7a1f092
--
-- The MIT License (MIT)
--
-- Copyright (c) 2017 luckytianyiyan
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
@ty0x2333
ty0x2333 / JsonResponse
Last active May 7, 2017 14:10
Remote Config Service Response Example
{
"version": "1.0",
"parameters": [
{
"name": "holiday_promo_enabled",
"default": true,
"values": {
"version 1.0.0": false
}
}
@ty0x2333
ty0x2333 / Makefile
Created March 31, 2017 04:56
Makefile Help
.PHONY: help
help: ## show this help message and exit
@echo "usage: make [target]"
@echo
@echo "targets:"
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
@ty0x2333
ty0x2333 / ios_update_i18n.sh
Last active March 31, 2017 04:54
iOS update i18n
#!/bin/sh
required_ver="1.1.2"
if [ ! $(command -v tystrings) ]; then
echo "❗️ tystrings command not found"
echo "sudo pip install tystrings"
exit 1
elif [ ! `python -c "import tystrings; from pkg_resources import parse_version; print 1 if parse_version(tystrings.__version__) >= parse_version(\"${required_ver}\") else 0;"` ]
then
echo "❗️ require tystrings version $required_ver"
#!/bin/sh
# https://gist.github.com/luckytianyiyan/8b27ef55465aec6bd77b6452b3d547f7
PATH=$PATH:/usr/local/bin
IFS=$'\n'
if [ ! $(command -v convert) ]; then
echo "❗️ convert command not found"
echo "brew install imagemagick"
exit 1
@ty0x2333
ty0x2333 / delete_app_extension.rb
Last active March 16, 2017 12:29
CLI Remove XCode App Extension
#!/usr/bin/env ruby
# https://gist.github.com/luckytianyiyan/59aad64e2871c45318958b765e0c8d1f
# Author: luckytianyiyan
# License: MIT
require 'xcodeproj'
project_path = ARGV[0]
project = Xcodeproj::Project.open(project_path)
main_target_name = ARGV[1]
dependency_target_name = ARGV[2]
@ty0x2333
ty0x2333 / 1ximage.py
Last active February 24, 2017 02:23
1ximage.py
#!/usr/bin/env python
# https://gist.github.com/luckytianyiyan/212cef95e7a85ef5a92cbb0c9e1033c4
import os
import fnmatch
import argparse
__author__ = 'luckytianyiyan@gmail.com'
__version__ = '0.2.0'