Skip to content

Instantly share code, notes, and snippets.

View sibsfinx's full-sized avatar
😸

Alexander Mescheryakov sibsfinx

😸
View GitHub Profile
@sibsfinx
sibsfinx / s3.js
Created February 2, 2016 10:33
deploy to amazon s3 with gulp (es6)
'use strict';
import path from 'path';
import awspublish from 'gulp-awspublish';
import parallelize from 'concurrent-transform';
import keys from 'config/keys.js'
export default function(gulp, plugins, args, config) {
let dirs = config.directories;
let build = dirs.destination;
@sibsfinx
sibsfinx / photoswipe.js.coffee
Created November 20, 2015 14:45
Photoswipe example
window.Gallery ||= {}
((app) ->
$(document).ready ->
$pswpElement = $('.pswp')[0]
$pswpCollection = $('@pswp-collection')
$pswpCollection.each ->
collection = $(@)
$pswpLinks = collection.find('[role*="pswp-link"]')
$pswpLinks.on 'click', (e) ->
@sibsfinx
sibsfinx / posts_controller.rb
Last active November 20, 2015 08:41
rails slug redirect
def show
@post = Post.friendly.find(params[:id])
if request.path != post_path(@post)
expires_in 8.hours, :public => true
return redirect_to @post, :status => :moved_permanently
end
end
@sibsfinx
sibsfinx / transfer.md
Last active July 7, 2023 12:54
Transfer entire server (digitalocean droplet downgrade)
sudo rsync -aAXvP --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"," /etc/sysconfig/network-scripts/*","/etc/network/interfaces"} username@hostname:/* /
@sibsfinx
sibsfinx / avatars.sass
Last active August 29, 2015 14:26
avatars animation
$transition-bounce: cubic-bezier(0.405, 1.510, 1.000, 0.915)
.messages-list
+translate3d(0,0,0)
.message-box-user-avatar
display: inline-block
position: relative
padding-right: 10px
&, &:focus, &:hover
@sibsfinx
sibsfinx / readme.md
Last active August 29, 2015 14:24
homebrew — switch versions

Sometimes you need to switch homebrew package versions.

For example, due to this issue with imagemagick:

This installation of RMagick was configured with ImageMagick 6.8.9 but ImageMagick 6.9.0-9 is in use.

Clone homebrew repo and find commit with necessary version in git log (mine was 1e30cbf for imagemagick 6.8.9-1)

git clone [email protected]:Homebrew/homebrew.git
@sibsfinx
sibsfinx / .vimrc
Last active August 17, 2017 12:03
html to haml in vim
nmap <leader>h :%!html2haml --erb 2> /dev/null<CR>:set ft=haml<CR>
vmap <leader>h :!html2haml --erb 2> /dev/null<CR>
@sibsfinx
sibsfinx / README.md
Last active August 29, 2015 14:21
nodejs without pain in the ass
@sibsfinx
sibsfinx / Gemfile.rb
Created April 22, 2015 14:33
UI Kit from partials in Middleman/Jekyll
gem "middleman"
gem "slim-rails", require: false
gem 'htmlentities'
@sibsfinx
sibsfinx / _outdated_browser.html.haml
Last active August 29, 2015 14:17
outdated browser
// views/shared/_outdated_browser.html.haml
.center-block-container
.center-block-content
#jr_inner{style: "max-width: 500px;"}
// ...
.container
.row
.col-md-6.col-md-offset-3.col-sm-8.col-sm-offset-2