Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tian Yiyan ty0x2333

🏠
Working from home
View GitHub Profile
@ty0x2333
ty0x2333 / SearchViewStyle.java
Created May 28, 2019 — forked from jaredrummler/SearchViewStyle.java
Customize the SearchView in an ActionBar for Android
View SearchViewStyle.java
/*
* 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
View stitching_images.py
# 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
View CLIDemo.scpt
-- 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
Remote Config Service Response Example
View JsonResponse
{
"version": "1.0",
"parameters": [
{
"name": "holiday_promo_enabled",
"default": true,
"values": {
"version 1.0.0": false
}
}
@ty0x2333
ty0x2333 / Makefile
Created Mar 31, 2017
Makefile Help
View Makefile
.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 Mar 31, 2017
iOS update i18n
View ios_update_i18n.sh
#!/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"
View process_debug_icon.sh
#!/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 Mar 16, 2017
CLI Remove XCode App Extension
View delete_app_extension.rb
#!/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]
View 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'
View clean_windows_ico_cache.bat
set iconcache=%localappdata%\IconCache.db
rem Close explorer
taskkill /f /im explorer.exe
rem Remove Icon Cache
attrib -h -s -r "%iconcache%\IconCache.db"
del /f "%iconcache%\IconCache.db"
attrib /s /d -h -s -r "%iconcache%\Microsoft\Windows\Explorer\*"
del /f "%iconcache%\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%iconcache%\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%iconcache%\Microsoft\Windows\Explorer\thumbcache_102.db"
You can’t perform that action at this time.