Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL
. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vim
Embeds SQL syntax highlighting inside Ruby heredocs labeled SQL
. This will also work to embed other syntaxen, e.g., HTML.
(requires https://github.com/exu/pgsql.vim)
syntax include @SQL syntax/pgsql.vim
hash = { 'foo' => 'bar' } | |
# Version 1 | |
hash = Hash[hash.map { |k, v| [k.to_sym, v] }] | |
# Version 2 | |
hash = hash.reduce({}) do |memo, (k, v)| | |
memo.tap { |m| m[k.to_sym] = v } | |
end |
import Foundation | |
#if os(iOS) | |
import UIKit | |
#else | |
import AppKit | |
#endif | |
/// Return string value currently on clipboard | |
func getPasteboardContents() -> String? { |
Use with the following
You must use this compontent on the route component where the form is shown not on the form component itself.
This is because this.props.route
is only added to route components, and I didn't want to pass that down through props.
Inspired by this Codepad
Feedback appreciated
#!/usr/bin/env python | |
import random | |
import struct | |
import sys | |
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833 | |
def ppNum(num): | |
return "%s (%s)" % (hex(num), num) |
function! ale_linters#gitcommit#commitlint#Handle(buffer, lines) abort | |
" Matches patterns line the following: | |
let l:pattern = '^\(✖\|⚠\)\s\+\(.*\) \(\[.*\]\)$' | |
let l:output = [] | |
let l:line = getline(1) | |
if l:line[0] != '#' | |
for l:match in ale#util#GetMatches(a:lines, l:pattern) | |
let l:item = { | |
\ 'lnum': 1, |
" vim:fdm=marker | |
" Editor basics {{{ | |
" Behave like Vim instead of Vi | |
set nocompatible | |
" Show a status line | |
set laststatus=2 | |
" Show the current cursor position |
See https://github.com/romainl/vim-devdocs for an up-to-date version.
Use :DD
without argument to look up the word under the cursor, scoped with the current filetype:
# A xterm-256color based TERMINFO that adds the escape sequences for italic. | |
# | |
# Install: | |
# | |
# tic xterm-256color-italic.terminfo | |
# | |
# Usage: | |
# | |
# export TERM=xterm-256color-italic | |
# |
-- TerminalVim.app | |
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm | |
-- To use this script: | |
-- 1. Open Automator and create a new Application | |
-- 2. Add the "Run Applescript" action | |
-- 3. Paste this script into the Run Applescript section | |
-- 4. Save the application as TerminalVim.app in your Applications folder | |
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default |