Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
@zoxon
zoxon / sessionStorage.js
Created February 17, 2018 14:00 — forked from Takazudo/sessionStorage.js
sessionStorage polyfill
/*
* Based on: http://www.quirksmode.org/js/cookies.html
* and https://github.com/wojodesign/local-storage-js/blob/master/storage.js
* and https://gist.github.com/350433
* License: http://www.opensource.org/licenses/MIT
*/
(function(window) {
'use strict';
window.sessionStorage = window.sessionStorage || {
@zoxon
zoxon / events.js
Created February 17, 2018 14:00 — forked from Takazudo/events.js
lazy event implementation
/* eventmodule */
/* Events */
var Events = {
on: function(events, callback) {
if(!this._observer) {
this._observer = $({});
}
this._observer.bind(events, callback);
@zoxon
zoxon / safariversiondetection.js
Created February 17, 2018 13:59 — forked from Takazudo/safariversiondetection.js
safari version detection
var oldSafari = (function() {
var ua = window.navigator.userAgent;
if(!/safari/i.test(ua)) {
return false;
}
if(/chrome/i.test(ua)) {
// chrome has 'Safari' in its ua.
return false;
}
if(/mobile/i.test(ua)) {
@zoxon
zoxon / htmlDprTweak.js
Created February 17, 2018 13:59 — forked from Takazudo/htmlDprTweak.js
devicePixelRatio className tweak
/**
* `html` class tweaking
* if `devicePixelRatio` was 2, switch html's class
* from `dpr-1` to `dpr-2`
*/
(function() {
var html = document.getElementsByTagName("html")[0];
/* helpers */
@zoxon
zoxon / detectPositionFixed.js
Created February 17, 2018 13:58 — forked from Takazudo/detectPositionFixed.js
position fixed detection
// a little modified version of
// position: fixed support detection from jQuery mobile.
//
// This script also defines Android2.x as out of support.
//
// https://github.com/jquery/jquery-mobile/blob/master/js/support.js
// http://demos.jquerymobile.com/1.4.4/toolbar-fixed/
// http://jimbergman.net/webkit-version-in-android-version/
Modernizr.addTest('positionfixed', function() {
@zoxon
zoxon / StaticContainer.js
Created February 9, 2018 09:55 — forked from jtulk/StaticContainer.js
The basics for delivering HTML content to a React component from a Node/Express Server
// a React Component that includes the header and footer
import React from "react";
import Header from "./../components/Header";
import Footer from "./../components/Footer";
import StaticContent from "./../components/StaticContent";
// use the route name from React Router to request the right data
const StaticContainer = ({ route }) => (
<div>
@zoxon
zoxon / constants.js
Created February 9, 2018 09:23 — forked from jtulk/constants.js
Caching an API Response With Redux-Thunk
const numMinutesToStale = 60;
export const timeToStale = numMinutesToStale * 60 * 1000;

Уровень 1

  • ps
  • top
  • scp
  • pushd / popd / cd -
  • bg/fg/ctrl+z
  • netstat
  • ifconfig
  • su/sudo
  • screen, tmux
@zoxon
zoxon / README-Template.md
Created November 20, 2017 09:47 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@zoxon
zoxon / RegEx
Created October 8, 2017 17:12 — forked from edbob/RegEx.js
js
// Метасимволы.
// \w Любой алфавитно-цифровой символ в верхнем и нижнем регистре и символ подчеркивания(тоже самое, что и [a-zA-Z0-9_]).
// \W Любой символ не являющийся подчеркиванием и не относящийся к алфавитно-цифровым
// \s любой пробельный символ (тоже самое, что [\r\n\f\v\t])
// \S Любой не пробельный символ (тоже самое, что [^\r\n\f\v\t])
// \d любая цифра (digit)
// \D любой не цифровой символ (тоже самое, что [^0-9])
// \v (вертикальная табуляция)
// \t (табуляция)