Skip to content

Instantly share code, notes, and snippets.

View falcon11's full-sized avatar
🌏
🐳

Ashoka falcon11

🌏
🐳
View GitHub Profile
@falcon11
falcon11 / qiniu_sslcert.py
Created January 17, 2023 01:02 — forked from lewangdev/qiniu_sslcert.py
qiniu_sslcert
#!/usr/bin/env python
## Dependencies:
#
# pip install qiniu
#
## Tips for Deploy certs to Qiniu:
#
# export DOMAIN=lewangdev.com
# export QINIU_DOMAIN=images.${DOMAIN},staticfiles.${DOMAIN}
@falcon11
falcon11 / git-add-commit-msg-prefix.md
Created May 9, 2022 12:40
Git: Add prefix to a range of commit messages

Original Link

Imagine that you cloned an open source project to contribute something. You implemented a bugfix through a series of atomic commits on a private branch. Just when you’re about to create a Pull Request to submit your changes, you discover in the contributor’s guide that you’re supposed to prefix each commit with the bug tracking number.

Rewriting the commit message of the last commit is easy:

git commit --amend
@falcon11
falcon11 / App-Bridging-Header.h
Last active February 15, 2022 03:03
iOS Security
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
void anti_gdb_debug(void);
int checkJailBroken(void);
@falcon11
falcon11 / usdt_erc20_transfer_demo.js
Created January 28, 2022 06:31 — forked from kangchihlun/usdt_erc20_transfer_demo.js
usdt(erc20) transfer demo
// Created by Chih.Lun.Kang
// 網路上找的範例大部分都不能用,後來嘗試數次只有這方法可行
// 主網的appid => 539ab33xxxx,要去Infura申請,在上面建立一個project
// #### NOTE #### : 要特別注意本身轉帳的帳號要儲備足夠數量的 eth 跟 btc
// #### 注意 #### : 目前使用人工轉換儲值手續費,建議在幣價好的時候一次換匯才划算
const USDTJSON = require('./build/contracts/USDT.json')
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
@falcon11
falcon11 / index.md
Created May 18, 2021 06:13 — forked from bvaughn/index.md
How to use profiling in production mode for react-dom
@falcon11
falcon11 / react-dynamic-import.md
Created May 9, 2021 05:36 — forked from adyontech/react-dynamic-import.md
A simple trick to dynamically import components in react.

AsyncLoadFile.jsx

import React, { Component } from 'react';

export default function asyncComponent(importComponent) {
    class AsyncComponent extends Component {
        /**
        * @constructor
        * @desc Represents AsyncComponent component
        * @param props Properties passed from parent component
@falcon11
falcon11 / Podfile-remove-static-dependencies.ruby
Last active November 17, 2020 07:50
Cocoapods Podfile remove subproject's static library and static framework from other linker flag
post_install do |installer|
# main project pod target
applicationTargets = [
'Pods-Mall',
]
embedded_targets = installer.aggregate_targets.select { |aggregate_target|
!(applicationTargets.include? aggregate_target.name)
}
@falcon11
falcon11 / AES_GCM.js
Created November 12, 2020 10:11
AES_GCM crypto
const base64Key = 'your key base64 encode';
let secretKey;
function getKeyArray(key) {
const bkey = atob(key);
const keyArray = [];
for (let i = 0; i < bkey.length; i += 1) {
keyArray.push(bkey.charCodeAt(i));
}
return keyArray;
@falcon11
falcon11 / AES_GCM.m
Created November 9, 2020 02:31
Objective-C AES/GCM/NoPadding crypto
// pod 'AesGcm'
#import <AesGcm/IAGAesGcm.h>
// replace with your own key, base64 encoding
static NSString * const AES_GCM_KEY = @"MTIzNDU2Nzg5MGFiY2RlZg==";
- (NSString *)encryptString:(NSString *)text {
NSData *key = [[NSData alloc] initWithBase64EncodedString:AES_GCM_KEY options:NSDataBase64DecodingIgnoreUnknownCharacters];
NSData *iv = [self randomKeyDataGeneratorWithNumberBits:96];
@falcon11
falcon11 / generate-ipa.sh
Created June 28, 2019 13:02
auto generate ipa
#!/bin/bash
BuidPath=build/`date +%F-%T`
ProjectName=HNPositionAsst
Configuration=Release
ExportOptionsPlist=ExportOptions.plist
IPA_NAME=app
mkdir -p $BuidPath
archivePath=$BuidPath/$ProjectName.xcarchive