Skip to content

Instantly share code, notes, and snippets.

View napcs's full-sized avatar

Brian P. Hogan napcs

View GitHub Profile
@jschoch
jschoch / HOW.md
Last active September 6, 2015 22:16

Phoenix Sockets and react.js components via reflux.js

In this post I will describe how to wire up some server state to our react components

Environment

This quick tutorial has only been tested with the following component versions. Beware trying to get this working with other versions. Phoenix is not yet 1.0 and it may change enough to make this no longer work.

Git Repo: [https://github.com/jschoch/reflux_eventbroker_react_phoenix_elixir/tree/logs]

@NickLaMuro
NickLaMuro / json_aliases.sh
Last active August 29, 2015 14:17
Bash aliases/functions for parsing and viewing json
# Pretty print json in the terminal like so:
# $ echo "{'json': 'stuff'}" | json
alias json='python -mjson.tool'
# Parses json. Each arg is a level deeper in the tree:
#
# Examples
#
# echo "{'json': {'foo': 'bar'}}" | parse_json
# => {'json': {'foo': 'bar'}}
@chrismccord
chrismccord / gist:be5c3cf8f89b252122ba
Last active January 2, 2018 01:26
Phoenix Gulpfile.coffee (Sass/CoffeeScript)
# Gulpfile.js
# // Note the new way of requesting CoffeeScript since 1.7.x
# require('coffee-script/register');
# // This bootstraps your Gulp's main file
# require('./Gulpfile.coffee');
# assets
# ├── Gulpfile.coffee
# ├── Gulpfile.js
augroup elixir
au!
au BufNewFile,BufRead *.ex,*.exs noremap <buffer> <leader>r :!mix test<cr>
au BufNewFile,BufRead *_test.exs noremap <buffer> <leader>r :exe "!mix test %:" . line(".")<cr>
au BufNewFile,BufRead *_test.exs noremap <buffer> <leader>R :!mix test %<cr>
au BufNewFile,BufRead *_test.exs noremap <buffer> <leader>a :!mix test<cr>
au BufNewFile,BufRead *.eex set filetype=eruby.html
augroup END
@tarruda
tarruda / .README.md
Last active September 27, 2021 13:21
Tmux/Vim integration

Some scripts/configurations that greatly improve tmux/vim workflows. The shell scripts target zsh but should be adaptable without much effort for other unix shells.

Features:

  • Transparently move between tmux panes and vim windows
  • Using the shell, open files in one vim instance per project or directory
  • Fully integrated copy/paste between tmux, vim and x11 using simple keybinds(need to install the xclip program)
  • Easily send text to any tmux pane without breaking your edit workflow(needs slimux

'vim-tmux-move.zsh', '.vimrc' and '.tmux.conf' cooperate so you can move transparently between tmux panes and vim windows using ALT + (arrow keys or jkhl). It was based on this gist

class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@dvessel
dvessel / README.mdown
Last active May 15, 2020 13:18
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@napcs
napcs / .tmux.clipboard
Created August 15, 2011 19:28
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@napcs
napcs / .vimrc
Last active December 14, 2022 17:40
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/napcs/532968/raw/vim.sh)
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/Dropbox/dotfiles/.vim"
if !empty($CONEMUBUILD)
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif