Skip to content

Instantly share code, notes, and snippets.

View Krasnov8953's full-sized avatar

krasnov8953 Krasnov8953

View GitHub Profile
mysqldump -uroot -proot database < dump.sql
@Krasnov8953
Krasnov8953 / gist:468691144e5df6cd955c0631d2fbf596
Created May 12, 2017 07:29
copy file from remote host via scp
scp root@serv:/home/text.php /Users/user/pathtolocalfolder/
@Krasnov8953
Krasnov8953 / gist:fb4cb9fc28841c009ca6c2e2b2f584ee
Last active May 26, 2017 10:05
zip folder on server with exclude server
zip -r bitvolution.zip bitvolution -x \*.git\*
tar xf fileName.tar.gz
@Krasnov8953
Krasnov8953 / gist:bc35958f04f8f5054ebb18d67d8736ac
Created May 17, 2017 14:59
squeeze footer to site bottom
* {
margin: 0;
padding: 0;
}
.content {
min-height: calc(100vh - 80px);
}
$(document).ready(function(){
$('.btn_blue').click(function(e){
e.preventDefault();
var destination = $('#comments').offset().top;
$('html, body').animate({
scrollTop: destination
}, 600);
});
});
@Krasnov8953
Krasnov8953 / gist:184662ac1278c7971986c02c95f4bfff
Created May 24, 2017 08:02
input type file appned filename to custom div
$('input[type="file"]').on('change', function (event, files, label) {
var file_name = this.value.replace(/\\/g, '/').replace(/.*\//, '')
$('.filename').text(file_name);
});
@Krasnov8953
Krasnov8953 / gist:5c4f4cdc829537ed6c42f74130835240
Created May 24, 2017 11:08
drag and drop files to input type file
$(document).ready(function(){
$('body').on('dragenter', function(){
$('input[type="file"]').addClass('drag');
console.log('enter');
});
$('input[type="file"]').on('dragleave', function(e){
e.stopPropagation();
$('input[type="file"]').removeClass('drag');
@Krasnov8953
Krasnov8953 / scroll.js
Created June 16, 2017 09:02
cmoozy scroll to ankor links
$('[data-action=link]').click(function(e){
e.preventDefault();
var toId = $(this).attr('href');
$('html,body').animate({
scrollTop:($(toId).offset().top)
}, 500);
});
import find from 'lodash/find';
import findIndex from 'lodash/findIndex';
import moment from 'moment';
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
const state = {
isAuthenticated: false,