Skip to content

Instantly share code, notes, and snippets.

View khalidchawtany's full-sized avatar

Khalid H. Ahmed khalidchawtany

View GitHub Profile
@james2doyle
james2doyle / NuxtValetDriver.php
Last active July 25, 2022 16:51
A Laravel Valet driver for running generated Nuxt.js sites. This driver assumes you have not changed the default public path (/dist) in the nuxt.config.js
<?php
/**
* NuxtValetDriver for running compiled nuxt.js sites
*/
class NuxtValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
@junegunn
junegunn / ag-change
Last active May 28, 2021 02:13
Restarting source command
#!/usr/bin/env bash
ag_source() {
local query
[ -z "$1" ] && query="^(?=.)" || query="$1"
ag --nogroup --column --color "$query" 2> /dev/null
}
filter() {
local query="$1"
@unclechu
unclechu / previous-tab-after-current-closed.vim
Created October 20, 2016 09:28
Vim: Go to previous tab after current tab closed
function! s:PreviousTab_StoreState()
let s:tab_current = tabpagenr()
let s:tab_last = tabpagenr('$')
endfunction
function! s:PreviousTab_TabClosed()
if s:tab_current > 1 && s:tab_current < s:tab_last
exec 'tabp'
endif
endfunction
autocmd TabEnter,TabLeave * call s:PreviousTab_StoreState()
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@rf-
rf- / nvim-client
Last active December 9, 2024 06:07
#!/usr/bin/env python
import pynvim, os, re, sys, time
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes
# buffers that have had `:bdelete` called on them and aren't in the buffer
# list, so we have to filter those out.
def get_listed_buffers(nvim):
return set(buf.number for buf in nvim.buffers \
if nvim.eval('buflisted(%d)' % buf.number))
@tarruda
tarruda / nvim-terminal-edit.py
Last active January 18, 2025 07:36
Edit file in host Neovim instance from a :terminal buffer
#!/usr/bin/env python
"""Edit a file in the host nvim instance."""
import os
import sys
from neovim import attach
args = sys.argv[1:]
if not args:
print "Usage: {} <filename> ...".format(sys.argv[0])
@equalsraf
equalsraf / gist:4685f7aef022a36c26d5
Last active November 15, 2017 22:13
Building Neovim with MSVC 2015

Check the pull request for the changes and the main issue for discussion. If you run into trouble check the Known Errors section at the end, or drop me a comment.

Requirements

  • MSVC 2015, cl should report > 19.*
  • Python 2 (required by libuv to get gyp) - python 3 will not work, see the issue
  • Git (required by libuv to get gyp)
  • libintl
  • You might need the Windows 10 SDK to be installed (unverified, please drop me a comment in #810, specially if you are in Windows8 or lower.)
@XVilka
XVilka / TrueColour.md
Last active April 27, 2025 10:17
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@kirb
kirb / gist:6149827
Last active February 26, 2020 16:20
Doing a respring the right way

Respringing the "right way" allows SpringBoard to save usage data. Otherwise, your usage data is lost and the standby/usage times are reset to "–" until you fully charge again.

Tweaks that respring the right way

  • Activator
  • Auxo
  • Flipswitch
  • Springtomize

(There are probably a few more)