Skip to content

Instantly share code, notes, and snippets.

@phanviet
phanviet / gist:b7ab5df45f5dbe3107976b79101b6d66
Created June 16, 2016 01:07
Custom Confirm Alert Default in Rails
//Override the default confirm dialog by rails
(function () {
$.rails.allowAction = function(link){
if (link.data("confirm") == undefined){
return true;
}
$.rails.showConfirmationDialog(link);
return false;
}
@phanviet
phanviet / custom-confirm-dialog-rails.js
Last active June 16, 2016 02:22
Custom Confirm Alert Default in Rails
//Override the default confirm dialog by rails
(function () {
$.rails.allowAction = function(link){
if (link.data("confirm") == undefined){
return true;
}
$.rails.showConfirmationDialog(link);
return false;
}
@phanviet
phanviet / .editorconfig
Last active January 15, 2024 09:40
editorconfig-rails
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@phanviet
phanviet / Guardfile
Created September 28, 2016 05:02
Guardfile
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec features) \
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
## Note: if you are using the `directories` clause above and you are not
## watching the project directory ('.'), then you will want to move
## the Guardfile to a watched dir and symlink it back, e.g.
@phanviet
phanviet / .rubocop.yml
Created September 28, 2016 05:02
.rubocop
inherit_from: .rubocop_todo.yml
AllCops:
Include:
- Rakefile
- config.ru
- lib/**/*.rake
Exclude:
- db/schema.rb
#################### Style ####################
set nocompatible " be iMproved, required
filetype off " required
call plug#begin('~/.local/share/nvim/plugged')
" Project management
Plug 'scrooloose/nerdtree'
call plug#begin('~/.local/share/nvim/plugged')
Plug 'tpope/vim-fugitive'
" Better default
Plug 'tpope/vim-sensible'
" Project management
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || \
tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) || \
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name