Skip to content

Instantly share code, notes, and snippets.

View neatlife's full-sized avatar
😀
Out sick

neatlife

😀
Out sick
View GitHub Profile
[xdebug]
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=0.0.0.0
xdebug.remote_port=9000
xdebug.idekey=VIM
restart_vmware() {
sudo /etc/init.d/vmware-tools stop
sudo /etc/init.d/vmware-tools start
}
@neatlife
neatlife / osx-vnc-hidden-options.md
Created January 27, 2020 02:47 — forked from jabenninghoff/osx-vnc-hidden-options.md
RemoteManagement "hidden" options

macOS Sierra (and possibly earlier) has some "hidden" screen sharing options:

If you're connecting to VNC using ssh tunneling, you can force macOS to listen only on localhost:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist VNCOnlyLocalConnections -bool yes

In newer versions of macOS, screen sharing will automatically re-lock the screen when you disconnect if it was locked when you first connected. To change this behavior, use:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement RestoreMachineState -bool NO

@neatlife
neatlife / AppDelegate.swift
Created May 5, 2020 02:13
关闭macos最后一个窗口退出应用
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
@neatlife
neatlife / epochms
Created May 7, 2020 03:10
c get current second
static long long epochms(void)
{
struct timespec tv;
clock_gettime(CLOCK_REALTIME, &tv);
return tv.tv_sec;
}
@neatlife
neatlife / vim-swift-setup.sh
Created May 7, 2020 08:30 — forked from mgrider/vim-swift-setup.sh
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim
# More about Vim packages: http://vimcasts.org/episodes/packages/
echo "--- creating ~/.vim/pack/bundle/start dir.."
mkdir -p ~/.vim/pack/bundle/start
echo "--- Cloning Apple's Swift repo.."
@echo off
Title Converter Office 2016 Retail to Volume
echo Press Enter to start VL-Conversion...
echo.
pause
echo.
for /f "tokens=6 delims=[]. " %%G in ('ver') do set win=%%G
@neatlife
neatlife / es1
Created June 30, 2020 10:14
es api usage
{
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"match_phrase": {
"send_type": {