Skip to content

Instantly share code, notes, and snippets.

View neatstudio's full-sized avatar
😅
不知道心情能干嘛

膘叔 neatstudio

😅
不知道心情能干嘛
View GitHub Profile
@neatstudio
neatstudio / ysqlite_create_migration.php
Last active April 23, 2022 04:03
根据functions.php中的ysqlite来衍生的临时创建migration
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTestTable extends Migration
{
public function __construct()
{
@neatstudio
neatstudio / distance.js
Created July 7, 2021 02:48
简单的JS来判断距离
let items = [
{
id: "3",
name: "XXX",
address: "BBBB",
lon: 114.1654,
lat: 22.27534,
},
{
id: "2",
http://source http://www.source {
tls idontknow@gmail.com
gzip
timeouts none
proxy / http://target {
}
filter rule {
content_type text/html.*
search_pattern target
@neatstudio
neatstudio / laravel-apache.conf
Last active November 28, 2019 07:20
laravel-apache.conf
<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
@neatstudio
neatstudio / disable.sh
Created July 31, 2018 14:36
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/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
@neatstudio
neatstudio / safejson.php
Created June 30, 2017 00:37
PHP JSON convert null to string
<?php
$data = [
"a" => 1,
"b" => null,
"c" => [
"d" => 2,
"e" => null,
"f" => [
"g" => 3,
"h" => null
@neatstudio
neatstudio / ConvertString2Array.php
Last active June 30, 2017 00:40
explode string to array
<?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;
}
@neatstudio
neatstudio / ArrayMap.php
Last active June 30, 2017 00:41
php : in array
<?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);