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 / 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 / check_app_link.php
Last active March 14, 2019 07:22
Can check whether support iOS universal links or Android app link
@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 / server.jpg
Last active April 9, 2019 07:05
PHP Swoole + Redis = live chats room
server.jpg

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 / 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)"
    
@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 / 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 / ssv_verify.php
Created September 17, 2020 04:08
PHP Ver. verify ECDSA
<?php
/**
* Validating Server-Side Verification (SSV) Callbacks
* https://developers.google.com/admob/android/rewarded-video-ssv
*
* @author showsky <showsky@gmail.com>
*/
function fetch_verifier_keys() {
@showsky
showsky / BaseEnum.php
Created March 22, 2021 04:45
PHP Enum Demo
<?php
abstract class BaseEnum
{
public static function toArray()
{
$reflection = new \ReflectionClass(static::class);
$constant = $reflection->getConstants();