Skip to content

Instantly share code, notes, and snippets.

View SergSlon's full-sized avatar
😀

Liamin Sergey SergSlon

😀
View GitHub Profile
hashtag_list = ['travelblog', 'travelblogger', 'traveler']
# prev_user_list = [] - if it's the first time you run it, use this line and comment the two below
prev_user_list = pd.read_csv('20181203-224633_users_followed_list.csv', delimiter=',').iloc[:,1:2] # useful to build a user log
prev_user_list = list(prev_user_list['0'])
new_followed = []
tag = -1
followed = 0
likes = 0
@SergSlon
SergSlon / README.md
Created October 29, 2016 07:34 — forked from karlkori/README.md
Shell redirection cheatsheet.
@SergSlon
SergSlon / mvvm.html
Created October 24, 2016 19:40 — forked from smelukov/mvvm.html
Very simple MVVM (dynamic data binding) on JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>MVVM</h1>
@SergSlon
SergSlon / mocha_vs_jasmine.md
Created September 23, 2016 12:40 — forked from monolithed/mocha_vs_jasmine.md
Mocha vs. Jasmine

Почему Mocha, а не Jasmine?

Ниже будут приведены аргументы в пользу выбора Mocha

  • Высокая популярность:
    — 2m против 400 k загузок в месяц

  • Высокая активность:
    — 1 890 против 1400 коммитов (всего)
    — 171 против 101 коммитов (последний год)

@SergSlon
SergSlon / stateful_hover.html
Created December 24, 2015 07:11
stateful hover
<style>
.button .menu-item {
pointer-events: none;
}
.button:focus .menu-item {
pointer-events: all;
}
</style>
String.prototype.replaceArray = function(find, replace) {
var replaceString = this;
for (var i = 0; i < find.length; i++) {
replaceString = replaceString.replace(find[i], replace[i]);
}
return replaceString;
};
String.prototype.replaceArray = function(find, replace) {
var replaceString = this;
@SergSlon
SergSlon / selectRange.js
Last active December 17, 2015 12:24
jquery selectRange
//SELECT TEXT RANGE
$.fn.selectRange = function(start, end) {
return this.each(function() {
if (this.setSelectionRange) {
this.focus();
this.setSelectionRange(start, end);
} else if (this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
@SergSlon
SergSlon / wordCase.js
Created November 9, 2015 10:56
Склонение слов по числам на JS
var wordCase = function( num, words ) {
var word = '';
num = Math.abs( num );
if ( num.toString().indexOf( '.' ) > -1 ) {
word = words[ 2 ];
} else {
word = (
num % 10 === 1 && num % 100 !== 11
@SergSlon
SergSlon / gist:c38bf4e987b24c005fe4
Created November 9, 2015 10:52
Clipboard: добавляет ссылку на сайт
jQuery(function($){
$(document).on("copy", function () {
var selection, html = "";
if (window.getSelection || document.getSelection) {
selection = window.getSelection ? window.getSelection() : document.getSelection();
if (selection.rangeCount) {
html = document.createElement("div");
for (var i = 0, n = selection.rangeCount; i < n; ++i) {
html.appendChild(selection.getRangeAt(i).cloneContents());
@SergSlon
SergSlon / gist:530c4440b42964e4f26b
Created October 30, 2015 07:50 — forked from ptz0n/gist:1646171
Recursive merge of arrays with integer keys
<?php
/**
* Merge two dimensional arrays my way
*
* Will merge keys even if they are of type int
*
* @param array $array1 Initial array to merge.
* @param array ... Variable list of arrays to recursively merge.
*