/**
* 取设备型号标识符,e.g. iPhone8,1
*
* @return 设备型号标识符
*/
- (NSString *_Nonnull)identifier {
struct utsname systemInfo;
uname(&systemInfo);
NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Run `./gen-custom.sh github.com/myorg/myprovider provider-name version` | |
# e.g.: `./gen-custom.sh github.com/mevansam/terraform-provider-cf cloudfoundry v1.0.0` | |
# This will place a provider-name.json directly in $HOME/.terraform.d/schemas | |
CUR="$(pwd)" | |
out="$CUR/schemas" | |
mkdir -p "$out" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT count(SCHEMA_NAME) as SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='xxx'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param fn fn是 async fn...修饰的函数, 本身已经是个Promise对象!! | |
*/ | |
export const wrapper = (fn) => (req, res, next) => Promise.resolve(fn(req, res, next)).catch(next) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RUN_MODE=develop | |
APP_NAME=wawazu-machine-server | |
SVC_NAME=$APP_NAME-$RUN_MODE | |
PRJ_PATH=/data/projects/$RUN_MODE/$APP_NAME | |
BIN_NAME=$APP_NAME-$RUN_MODE | |
RUN_PATH=/data/GORUN/$RUN_MODE/$APP_NAME | |
BUILDNO=`date '+%Y%m%d%H%M%S'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use php curl multi, rolling request url. | |
* | |
* @author [email protected] | |
*/ | |
class CurlRoll | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function(){ | |
console.log("timeout") | |
}, 0); | |
setImmediate(function(){ | |
console.log("immediate") | |
}); | |
process.nextTick(function(){ | |
console.log('next tick') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
s := []int{1,2,3,4,5} | |
nodes := append(s[:index], s[(index+1):]...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const func = func = (...args) => {func.info(...args)}; | |
func.info = (...args) => {console.info.apply(this, args)}; | |
// test | |
func(1,2,3,4); | |
// out put: | |
// ø 1 2 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rolling_curl($curl_multi_data = []) | |
{ | |
$queue = curl_multi_init(); | |
$map = array(); | |
foreach ($curl_multi_data as $curl_data) { | |
$ch = curl_init(); | |
$data = $curl_data['data']; | |
if($curl_data['is_post']) |
NewerOlder