Skip to content

Instantly share code, notes, and snippets.

View cedmundo's full-sized avatar

Carlos M cedmundo

  • cedmundo
  • México
View GitHub Profile
@cedmundo
cedmundo / init.vim
Last active May 9, 2022 14:57
nvim/init.vim
set shell=/bin/bash
" Plugins
call plug#begin('~/.vim/plugged')
Plug 'ycm-core/YouCompleteMe'
Plug 'dense-analysis/ale'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug '~/.fzf'
Plug 'junegunn/fzf.vim'
@cedmundo
cedmundo / .tmux.conf
Last active May 9, 2022 14:56
My personal configuration file for tmux
# zsh zsh zsh
set-option -g default-shell /bin/zsh
# remap prefix from 'C-b' to 'F1'
unbind C-b
set-option -g prefix F1
bind-key F1 send-prefix
# split panes using F3 and F4 and F6
bind F2 split-window -h -c '#{pane_current_path}' \; resize-pane -R 20
@cedmundo
cedmundo / build-on-demand.sh
Last active December 11, 2017 18:52
Example of building on demand for a project in Go
#!/usr/bin/env bash
function killpidfile {
echo "Killing process"
if [ -f ".debug.pid" ]; then
kill -15 $(cat .debug.pid)
fi
}
function build {
@cedmundo
cedmundo / htdebug
Last active March 6, 2018 05:26
Simple script that helps to debug output of curl while testing some HTTP API endpoints, if cannot parse JSON then will show up as lynx page.
#!/usr/bin/env bash
content=`cat /dev/stdin`
value=`echo $content | python -m 'json.tool' 2>&1`
if [ "$value" == "No JSON object could be decoded" ]; then
echo "$content" | lynx -stdin
else
echo "$value" | pygmentize -l json
fi
@cedmundo
cedmundo / .vimrc
Last active March 21, 2018 00:32
My personal vimrc (no golang)
"{{{Auto Commands
" Automatically cd into the directory that the file is in
autocmd VimEnter * silent! :cd%:p:h
" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
" Restore cursor position to where it was before
augroup JumpCursorOnEdit

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@cedmundo
cedmundo / Golang .vimrc
Last active March 21, 2018 00:32
My personal vimrc for golang, requires vundle.
" Description: Vimrc with golang compatibility. Replaces default vimrc
" Author: Carlos Edmundo Martinez Mendoza.
" Created: 2016-03-09 00:00:00
" Necesary for lots of cool vim things
set nocompatible
" {{{ Auto commands
"
" Automatically cd into the directory that the file is in
@cedmundo
cedmundo / hello.go
Created March 29, 2016 03:00
Testing in embedding
package main
import "fmt"
func main(){
fmt.Println("Hello world!")
}
#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
struct timeval start, end;
long mtime, seconds, useconds;
gettimeofday(&start, NULL);