Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
...

Ahmed El Gabri ahmedelgabri

🤔
...
View GitHub Profile
@ahmedelgabri
ahmedelgabri / statusline.vim
Last active Oct 9, 2020
Trying to build my vim statusline without plugins
View statusline.vim
" Statusline & Tabline/Buffer line
" Dynamically getting the fg/bg colors from the current colorscheme, returns hex which is enough for me to use in Neovim
" Needs to figure out how to return cterm values too
let fgcolor=synIDattr(synIDtrans(hlID("Normal")), "fg", "gui")
let bgcolor=synIDattr(synIDtrans(hlID("Normal")), "bg", "gui")
" Tabline/Buffer line
set showtabline=2
set tabline="%1T"
View default
#
# aerc default styleset
#
# This styleset uses the terminal defaults as its base.
# More information on how to configure the styleset can be found in
# the aerc-styleset(7) manpage. Please read the manual before
# modifying or creating a styleset.
*.default=true
*.selected.reverse=toggle
View VimScriptForPythonDevelopers.MD

Vim Script for Python Developers

A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with programming in Python.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a similar guide for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping, [abbrevi

View ipad-dev.md

Essential Apps

  • Blink: Install Blink on your iPad
  • Tailscale: Install Tailscale on all your devices.
  • mosh: Install mosh on all your devices. It comes with Blink by default.

Nice to have apps

Amphetamine for Mac

View md-to-html.js
var unified = require('unified')
var markdown = require('remark-parse')
var remark2rehype = require('remark-rehype')
var html = require('rehype-stringify')
var report = require('vfile-reporter')
unified()
.use(markdown)
.use(remark2rehype)
.use(html)
@ahmedelgabri
ahmedelgabri / about.md
Created Mar 7, 2020 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
View about.md
@ahmedelgabri
ahmedelgabri / Sublime Text command log
Created Sep 21, 2013
Log Sublime Text command in the console, very helpful when trying to figure out command you want to create shortcuts for.
View Sublime Text command log
sublime.log_commands(True)
@ahmedelgabri
ahmedelgabri / ts.md
Created Jul 2, 2019
global types in Typescript
View ts.md

I'm migrating a legacy codebase to Typescript & it has some global objects attached to window & I want these to be available always.

So I created globals.d.ts file that looks something like this

interface Foo {
  a: string;
  b: number;
}
View .tern-config
{
"ecmaVersion": 6,
"libs": [
"ecma5",
"ecma6",
"browser"
],
"loadEagerly": [],
"async": true,
"plugins": {
@ahmedelgabri
ahmedelgabri / gist:8122545
Last active Oct 17, 2018
Shell function to open a static server (Python, Ruby or PHP)
View gist:8122545

Static server shell function

A Modified function of Paul Irish's StaticServer shell function, according to this gist You can run static servers for many languages.

How it works

$ staticServer <lang> <port> #port is optional, default is 8000
You can’t perform that action at this time.