This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function(){ | |
var grid = $('#masonry-container').masonry({ | |
itemSelector: '.box', | |
columnWidth: 300, | |
gutterWidth: 10, | |
isFitWidth: true | |
}); | |
function onLayout() { | |
$('#masonry-container').css('visibility', 'visible'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake refinery:override view=refinery/pages/* | |
$ rake refinery:override view=layouts/* | |
$ rake refinery:override view=refinery/blog/shared/* | |
$ rake refinery:override view=refinery/blog/posts/* | |
$ rake refinery:override view=refinery/* | |
$ rake refinery:override controller=refinery/blog/* | |
$ rake refinery:override controller=refinery/* | |
trim '.html.erb', '.rb'. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav class="navbar navbar-default" role="navigation"> | |
<div class="container-fluid"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#example_1"> | |
<span class="sr-only">Toggle navigation</span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'jeffkreeftmeijer/vim-numbertoggle' | |
Plug 'mattn/emmet-vim' | |
Plug '907th/vim-auto-save' | |
Plug 'vim-scripts/restore_view.vim' | |
Plug 'fxn/vim-monochrome' | |
Plug 'gosukiwi/vim-atom-dark' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set show-mode-in-prompt off | |
# set vi-ins-mode-string \1\2 \1\2 | |
# set vi-cmd-mode-string \1\2 \1\2 | |
export HISTCONTROL=ignoreboth:erasedups | |
export HISTSIZE=1000 | |
export HISTFILESIZE=20000 | |
# append to the history file, don't overwrite it | |
shopt -s histappend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xrandr --output VGA1 --off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let slugify = function(text) { | |
return text.toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("/admin/media/" + mediaId + "/update_image", { | |
method: 'post', | |
body: JSON.stringify(myData), | |
headers: { | |
'Content-Type': 'application/json', | |
'X-CSRF-Token': Rails.csrfToken() | |
}, | |
credentials: 'same-origin' | |
}).then(function(response) { | |
return response.json(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function docReady(fn) { | |
// see if DOM is already available | |
if (document.readyState === "complete" || document.readyState === "interactive") { | |
// call on next available tick | |
setTimeout(fn, 1); | |
} else { | |
document.addEventListener("DOMContentLoaded", fn); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Croppeable | |
include ActiveSupport::Concern | |
include Rails.application.routes.url_helpers | |
def crop_and_save(fileName=nil, caption=nil, image_options = {}) | |
redraw_params = create_redraw_params(image_options) | |
processed_attachment_path = create_variant(redraw_params) | |
save_new_file(fileName, caption, processed_attachment_path) | |
end |