Skip to content

Instantly share code, notes, and snippets.

https://drupal.stackexchange.com/questions/145690/untrusted-host-localhost-in/145994#145994
@nic0-lab
nic0-lab / gist:9ad496ef8ba0cc7bd19c4689499ef646
Created June 4, 2017 15:33
Config Vim as a Python IDE by Martin Brochhaus
" Sample .vimrc file by Martin Brochhaus
" Presented at PyCon APAC 2012
" ============================================
" Note to myself:
" DO NOT USE <C-z> FOR SAVING WHEN PRESENTING!
" ============================================
function! python#SaveAndExecutePython()
" SOURCE [reusable window]: https://github.com/fatih/vim-go/blob/master/autoload/go/ui.vim
" save and reload the current file
silent execute "update | edit"
" get file path of current file
let s:current_buffer_file_path = expand("%")
let s:output_buffer_name = "Python"
[
'{{repeat(5, 5)}}',
{
friends: [
'{{repeat(10)}}',
{
id: '{{index()}}',
name: '{{firstName()}} {{surname()}}'
}
let g:lightline = {
\ 'colorscheme': 'seoul256',
\ 'mode_map': {'c': 'NORMAL'},
\ 'active': {
\ 'right': [ [ 'syntastic', 'lineinfo' ],
\ [ 'percent' ], [ 'winform' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ] ],
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'branch', 'filename' ] ]
\ },
\ 'component_function': {
@nic0-lab
nic0-lab / ctags definitions for Javascript
Created August 4, 2017 05:05 — forked from tim-smart/ctags definitions for Javascript
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/
@nic0-lab
nic0-lab / javascript_ctags_config
Created August 4, 2017 07:05
.ctags configuration
--languages=-JavaScript
--langdef=js
--langmap=js:.js
--regex-js=/^(var)?[ \t]*([A-Za-z0-9_$]*\.)*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\3/a,array/
--regex-js=/^(var)?[ \t]*([A-Za-z0-9_$]*\.)*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\3/o,object/
--regex-js=/^(var)?[ \t]*([A-Za-z0-9_$]*\.)*([A-Za-z0-9_$]+)[ \t]*=[^{\[]*$/\3/r,var/
--regex-js=/^var[ \t]+([A-Za-z0-9._$]+)[ \t]*=[ \t]*[A-Za-z0-9_$]+.extend/\1/f,function/
--regex-js=/^[ \t]*([A-Za-z0-9_$]*\.)*([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*function/\2/f,function/
--regex-js=/^[ \t]*function[ \t]*([A-Za-z0-9_$]+)[ \t]*\(/\1/f,function/
@nic0-lab
nic0-lab / Vim Tips
Last active June 23, 2018 15:47
Vim Tips
" Supprimer tous les ^M (carriage return) en fin de ligne
:%s/\r\(\n\)/\1/g
" Simple re-format for minified Javascript
command! UnMinify call UnMinify()
function! UnMinify()
%s/{\ze[^\r\n]/{\r/g
%s/){/) {/g
%s/};\?\ze[^\r\n]/\0\r/g
%s/;\ze[^\r\n]/;\r/g
@nic0-lab
nic0-lab / Vim install
Last active June 23, 2018 15:52
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@nic0-lab
nic0-lab / dotfiles
Created June 1, 2018 17:21
dotfiles repository
https://github.com/bluewww/emacs-dotfiles
https://github.com/EdwardJRoss/dotfiles
https://github.com/PinkFLoyd92/Emacs
https://github.com/tim-millar/emacs.d
https://github.com/dieggsy/dotfiles
https://github.com/Grimscythe1983/.emacs.d
https://github.com/xeals/emacs.d
https://github.com/jgkamat/dotfiles
https://github.com/wpcarro/dotfiles/
https://github.com/InspectorMustache/Dotdotdotfiles