Skip to content

Instantly share code, notes, and snippets.

David Mejorado davidmh

Block or report user

Report or block davidmh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View toggle-selected-trip.diff
diff --git a/src/App.js b/src/App.js
index b8ec935..04a4045 100644
--- a/src/App.js
+++ b/src/App.js
@@ -30,9 +30,10 @@ class App extends Component {
}
selectTrip = tripId => {
- this.setState({
- selectedTrip: tripId
View discourse.js
require('isomorphic-fetch')
const { createFetch, base, accept, method, params, parse } = require('http-client')
module.exports = (base_url, api_username, api_key) => {
const auth = params({ api_username, api_key })
const requestFactory = method_name => (pathname, data = {}) => {
const req = createFetch(
base(base_url),
View netrw_explorer_toggle.vim
" netrw
let g:netrw_banner = 0 " hide banner
let g:netrw_altv=1 " open splits to the right
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
function! s:open_netrw()
" Grab the current file name
let file_name = expand("%:t")
" Open a 20-column left-side netrw explorer in the directory for the current
@davidmh
davidmh / tmux.vim
Created Sep 26, 2017
tmux mappings
View tmux.vim
command! ZoomServer call system('tmux resize-pane -Z -t 2')
command! ZoomClient call system('tmux resize-pane -Z -t 1')
command! RestartClient call system('tmux send-keys -t 1 C-c "npm run dev" Enter')
command! RestartServer call system('tmux send-keys -t 2 C-c "npm run start-dev" Enter')
nnoremap <silent> <leader>zc :ZoomClient<CR>
nnoremap <silent> <leader>zs :ZoomServer<CR>
nnoremap <silent> <leader>rc :RestartClient<CR>
nnoremap <silent> <leader>rs :RestartServer<CR>
@davidmh
davidmh / pre-push
Created Sep 16, 2017
Run npm tests before pushing
View pre-push
#!/bin/sh
# Called by "git push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
@davidmh
davidmh / !react-sublime-snippets.md
Last active Sep 6, 2017 — forked from thejase/!react-sublime-snippets.md
Sublime Text Completions and Snippets for React
View !react-sublime-snippets.md
@davidmh
davidmh / presentation.vim
Last active Sep 5, 2018
Presentation mode with Goyo + vim-markdown
View presentation.vim
" https://asciinema.org/a/kE1398clJWRPPhk3lWbtvbanF
" Presentation mode
"
" use <left> and <right> to navigate the slides
"
" https://github.com/plasticboy/vim-markdown Makes folds by sections (among many other things)
" https://github.com/junegunn/goyo.vim Distraction-free writing (and reading) in Vim
function! s:enter_presentation()
View fzf+ag.vim
" Ag / git grep
function! s:ag_to_qf(line)
let parts = split(a:line, ':')
return { 'filename': parts[0]
\,'lnum': parts[1]
\,'col': parts[2]
\,'text': join(parts[3:], ':')
\ }
endfunction
@davidmh
davidmh / nvim-term-maps.vim
Last active Jun 22, 2016
Mappings and basic REPL for Neovim's :term
View nvim-term-maps.vim
" Term bindings
"
" Spawns
" open shell on the current window
nnoremap <c-t><c-e> :e term://$SHELL<CR>A
" open vertical shell
nnoremap <c-t><c-v> <c-w><c-v><c-w><c-l>:e term://$SHELL<CR>A
" open horizontal shell
nnoremap <c-t><c-s> <c-w><c-s><c-w><c-j>:e term://$SHELL<CR>A
"
@davidmh
davidmh / init.vim
Last active Feb 18, 2018
neovim config
View init.vim
let g:mapleader = "\<SPACE>"
" Show white spaces at the end of a line
set list listchars=tab:▸\ ,eol:¬,trail:·
" edit this nvim config
nnoremap <silent> <leader>ev :vs $HOME/.config/nvim/init.vim<CR>
" auto-reload
augroup VimConfig
au!
You can’t perform that action at this time.