- ps
- top
- scp
- pushd / popd / cd -
- bg/fg/ctrl+z
- netstat
- ifconfig
- su/sudo
- screen, tmux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numMinutesToStale = 60; | |
export const timeToStale = numMinutesToStale * 60 * 1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Метасимволы. | |
// \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 (табуляция) |
Some reference notes of the most common used commands.
Contents:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), |
Contents: