Skip to content

Instantly share code, notes, and snippets.

View hiyali's full-sized avatar
🌎
Focusing

Salam Hiyali hiyali

🌎
Focusing
View GitHub Profile
@hiyali
hiyali / cordova-wechat-share-app-delegate.md
Created March 23, 2018 11:27
cordova-wechat-share-app-delegate.md

修改文件AppDelegate+IonicDeeplink.m的openURL方法,内容改成下面的:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    BOOL handled = NO;

    if ([[url absoluteString] rangeOfString:@"liepiao"].location == 0) {
        IonicDeeplinkPlugin *plugin = [self.viewController getCommandInstance:PLUGIN_NAME];
        if(plugin == nil) {
            NSLog(@"Unable to get instance of command plugin");
 }
@hiyali
hiyali / After_increase_volume_size.md
Last active March 19, 2019 11:24
After increase volume size

Expand Partition to New Available Disk Volume

$ sudo growpart /dev/xvda 1

Expand file system

$ sudo resize2fs /dev/xvda1
@hiyali
hiyali / optimize_linux.md
Last active June 9, 2019 06:40
Optimize Linux

Find fd limit:

cat /proc/sys/fs/file-max

Check limit:

ulimit -n
@hiyali
hiyali / upload-file-to-amazon-s3-golang.md
Last active November 20, 2023 08:32
Upload file to amazon s3 with s3 filepath on golang

syncer.go

/*
  https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object-acl.html
  https://docs.aws.amazon.com/zh_cn/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
  https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
  https://docs.aws.amazon.com/sdk-for-go/api/aws/

  1. Create bucket in s3 & get the keys
  - login to UI web aws s3 interface
package main
import (
"fmt"
"time"
"sync"
)
func work(serverChan chan int, wg *sync.WaitGroup, server int, thing string) {
defer wg.Done()