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 Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreateTestTable extends Migration | |
{ | |
public function __construct() | |
{ |
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
let items = [ | |
{ | |
id: "3", | |
name: "XXX", | |
address: "BBBB", | |
lon: 114.1654, | |
lat: 22.27534, | |
}, | |
{ | |
id: "2", |
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
http://source http://www.source { | |
tls [email protected] | |
gzip | |
timeouts none | |
proxy / http://target { | |
} | |
filter rule { | |
content_type text/html.* | |
search_pattern target |
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
<VirtualHost *:9999> | |
ServerAdmin webmaster@{website} | |
ServerName {website} | |
DocumentRoot /server/wwwroot/{website}/public | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /server/wwwroot/{website}/public/> | |
Options FollowSymLinks |
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 | |
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after. | |
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
# Get active services: launchctl list | grep -v "\-\t0" | |
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents | |
# Agents to disable | |
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi |
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 | |
$data = [ | |
"a" => 1, | |
"b" => null, | |
"c" => [ | |
"d" => 2, | |
"e" => null, | |
"f" => [ | |
"g" => 3, | |
"h" => null |
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 | |
$str = "101|1;0|4;1|0;0|0;0|0"; | |
//第一种 | |
$array = explode(';', $str); | |
$items = []; | |
foreach($array as $v){ | |
list($k, $v) = explode('|', $v); | |
if(empty($v)){ | |
continue; | |
} |
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 | |
$array = array( | |
1 => array('n' => 'a1', 'p' => 1, 't' => 'a', 'bk' => array('2'), 'cd' => 2), | |
2 => array('n' => 'a2', 'p' => 2, 't' => 'a', 'ak' => array('3', '4'), 'cd' => 1), | |
3 => array('n' => 'a3', 'p' => 3, 't' => 'a', 'cd' => 1), | |
); | |
$ret = in_array(false, array_map(function ($item) { | |
return $item['cd'] ? true :false; | |
}, $array)); | |
var_dump($ret); |