Skip to content

Instantly share code, notes, and snippets.

View showsky's full-sized avatar
👋
Hello World~

Ting Cheng showsky

👋
Hello World~
View GitHub Profile
@showsky
showsky / bg_dump.php
Last active April 20, 2020 08:14
BigQuery Dump
<?php
$job_type = "QUERY";
$save_folder_path = './feebee_bigquery_log';
$start_timestamp = '1583370000000';
$end_timestamp = '1583391600000';
$size = 1000;
$bg_ls_command = sprintf(
'/usr/local/bin/bq ls -j -a --format=json --min_creation_time=%s --max_creation_time=%s --message_type=INFO -n %s',
@showsky
showsky / values-themes.xml
Created April 8, 2020 03:26
Manager All Android Level themes
<resources>
<style name="Base.V0.AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/yellow</item>
<item name="colorPrimaryDark">@color/yellow_dark</item>
<item name="colorAccent">@color/blue_1</item>
</style>
<style name="AppTheme" parent="Base.V0.AppTheme">
<!-- do somthing-->
@showsky
showsky / ubuntu.md
Created February 10, 2020 03:42
Ubuntu Install Memo

Ubuntu Install Memo

Shell

  • install oh-my-zsh

    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    

Sitemaji SDK (v1.12.3)

Download

Download as a gradle dependency in your project. To use it you will have to edit your gradle files in two places. First you need to add new maven repository to your top level gradle file. The repository is a link to your GitHub repository created in step one. Here's what you need to add to use SitemajiSDK library:

...
@showsky
showsky / server.jpg
Last active April 9, 2019 07:05
PHP Swoole + Redis = live chats room
server.jpg
@showsky
showsky / autocomplete.php
Last active April 3, 2019 05:09
Redis + PHP = AutoComplete
<?php
function init_suggest() {
$redis = new Redis();
$redis->pconnect('127.0.0.1', 6379);
$redis->delete('autocomplete');
$keyword = array(
'全境封鎖',
'火線獵殺',
@showsky
showsky / check_app_link.php
Last active March 14, 2019 07:22
Can check whether support iOS universal links or Android app link
@showsky
showsky / apollo.php
Last active March 27, 2019 05:56
Apollo Leave System
<?php
function curl_get($url, $cookie = NULL) {
$header_array = array(
'Referer: https://hrm.mayohr.com/ta/supervisor/shiftscheduleapprovelist',
'Content-Type: application/json',
'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36'
);
if (isset($cookie)) {
$header_array[] = 'Cookie: ' . $cookie;
@showsky
showsky / LCS.php
Created August 17, 2018 08:42
LCS
<?php
class LCS {
private $str1;
private $str2;
private $c = array();
/*返回串一和串二的最长公共子序列*/
function getLCS($str1, $str2, $len1 = 0, $len2 = 0) {
$this->str1 = $str1;
@showsky
showsky / CustomSwiperRefreshLayout.java
Created April 20, 2018 03:05
SwiperRefreshLayout 對於水平滾動衝突
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
/**
* Created by showsky on 2018/4/18.