Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
@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 (табуляция)
@zoxon
zoxon / git.md
Created August 29, 2017 04:57 — forked from magicznyleszek/git.md
Git Cheatsheet
@zoxon
zoxon / hex-to-rgb.js
Created August 29, 2017 04:25 — forked from magicznyleszek/hex-to-rgb.js
Hex to RGB
function hexToRgb(hex) {
// Expand shorthand form ("#FFF") to full form ("#FFFFF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
// return hex values
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
@zoxon
zoxon / regex.md
Created August 29, 2017 04:24 — forked from magicznyleszek/regex.md
RegEx Cheatsheet