trans hello # привет
trans hello | say # it's saying!
This file contains hidden or 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 {BadRequestError} = require('restify/lib/errors'); | |
const Joi = require('joi'); | |
module.exports = function validationPlugin() { | |
const fields = ['params', 'query', 'body']; | |
return function validationMiddleware(req, res, next) { | |
if (!req.route || !req.route.validate) { | |
return next(); | |
} |
This file contains hidden or 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
#!/bin/sh | |
# List changed files | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_file() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} | |
check_file "package.json" "npm install" |
This file contains hidden or 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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
module.exports = { | |
foo: 'bar' | |
}; | |
},{}],2:[function(require,module,exports){ | |
var foo = require('./foo.js'); | |
},{"./foo.js":1}]},{},[2]); |
This file contains hidden or 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 React = require('react'); | |
const classNames = require('classnames'); | |
const Input = React.createClass({ | |
propTypes: { | |
id: React.PropTypes.string.isRequired, | |
className: React.PropTypes.string, | |
title: React.PropTypes.string, | |
help: React.PropTypes.string, | |
type: React.PropTypes.oneOf([ |
Find:
/^module\.exports\s+=\s+(.+?);?$/
Replace:
export default $1;
This file contains hidden or 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
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] |
This file contains hidden or 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
require('crypto').randomBytes(32, function(ex, buf) { | |
console.log(buf.toString('hex')); | |
}); |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install wget -y | |
wget -qO- https://get.docker.com/ | sh |
This file contains hidden or 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 compress(objects) { | |
const fieldsSet = {}; | |
for (let i = 0; i < objects.length; i++) { | |
const keys = Object.keys(objects[i]); | |
for (let j = 0; j < keys.length; j++) { | |
fieldsSet[keys[j]] = 1; | |
} | |
} | |
const fields = Object.keys(fieldsSet); |