Skip to content

Instantly share code, notes, and snippets.

View uran1980's full-sized avatar

Ivan Yakovlev uran1980

View GitHub Profile
@uran1980
uran1980 / jquery.debonce.js
Last active January 21, 2018 17:24
jquery.debonce.js
/**
* @see https://stackoverflow.com/questions/28948383/how-to-implement-debounce-fn-into-jquery-keyup-event
* @see http://jsfiddle.net/bjb9s2w5/
* @see https://learn.jquery.com/plugins/basic-plugin-creation/
*
* Usage:
*
* ```
* $('input').on('keyup', $.fn.debonce(function () {
* // do some ajax request...
@uran1980
uran1980 / pub-sub.js
Created September 13, 2017 15:09 — forked from reu/pub-sub.js
node.js redis pub-sub example
var redis = require("redis")
, subscriber = redis.createClient()
, publisher = redis.createClient();
subscriber.on("message", function(channel, message) {
console.log("Message '" + message + "' on channel '" + channel + "' arrived!")
});
subscriber.subscribe("test");
@uran1980
uran1980 / cron-jobs-view.md
Last active August 1, 2017 16:36
Cron Jobs View

View Root’s Cron Jobs

crontab -l

View a User’s Cron Jobs

crontab -u username -l
@uran1980
uran1980 / SingletonEnforcer.js
Created July 24, 2017 20:47 — forked from dmnsgn/SingletonEnforcer.js
ES6 singleton pattern: use Symbol to ensure singularity
// http://stackoverflow.com/a/26227662/1527470
const singleton = Symbol();
const singletonEnforcer = Symbol();
class SingletonEnforcer {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}
@uran1980
uran1980 / gif-animation.css
Created July 21, 2017 08:25
gif animation
/* @see https://www.innos.com/ru/#/intro */
.intro__phone-screen,
.intro__phone-screen:after {
height: 575px;
position: absolute;
content: ''
}
.intro__phone-screen {
top: 57px;
left: 18px;
@uran1980
uran1980 / Шаблон-ТЗ.md
Last active June 24, 2017 13:42
Шаблон-ТЗ.md

Шаблон ТЗ на новую задачу


  • Заголовок (краткое название)
  • Описание (краткое но подробное описание новой задачи/фитчи)
  • Ссылки на страницы где будет размещена (обязательно)
  • Ссылки на документацию (опционально, если есть)
  • Скриношоты (опционально)
@uran1980
uran1980 / maintenance.html
Last active May 22, 2017 09:53
maintenance.html
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-type">
<title>Site on maintenance...</title>
<style media="screen" type="text/css">
body
{
background: #f1f1f1;
font-family: "HelveticaNeue", Helvetica, Arial, sans-serif;
@uran1980
uran1980 / how-to-upgrade-php-from-5.6-to-7.1-on-macos-sierra-with-homebrew.md
Last active February 6, 2022 05:29
How to upgrade php from 5.6 to 7.1 on macOS Sierra with homebrew
@uran1980
uran1980 / confetti.js
Last active April 5, 2017 19:41
confetti.js
// @see https://getgrav.org/blog/grav-1.2-released
jQuery(document).ready(function() {
var NUM_CONFETTI = 75,
COLORS = [
[85, 71, 106],
[174, 61, 99],
[219, 56, 83],
[244, 92, 68],
[248, 182, 70]
],
@uran1980
uran1980 / gist:6d090d01bb013883128395a0d2a2f14b
Created February 11, 2017 15:00 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote