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
/* | |
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$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 fs = require('fs') | |
const path = require('path') | |
const spawn = require('child_process').spawn | |
// Gradient overlay example | |
// http://www.imagemagick.org/script/command-line-processing.php#input | |
const photoWriteStream = fs.createWriteStream( | |
path.join(__dirname, '/img-02-js-out.jpg') | |
) |
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
# http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/ | |
# Show | |
defaults write com.apple.finder AppleShowAllFiles YES | |
# Hide | |
defaults write com.apple.finder AppleShowAllFiles NO |
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
Buffer.from('foo').toString('base64') |
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
'use strict' | |
require('dotenv').config() | |
const log = require('debug')('temp') | |
const nodeFetch = require('node-fetch') | |
const ENDPOINT = 'https://online.moysklad.ru/api/remap/1.1' | |
const { MOYSKLAD_LOGIN, MOYSKLAD_PASSWORD } = process.env | |
const auth = 'Basic ' + Buffer.from(`${MOYSKLAD_LOGIN}:${MOYSKLAD_PASSWORD}`, 'utf8') |
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
'use strict' | |
function promisefyFunction (func, context) { | |
return function () { | |
let args = Array.prototype.slice.call(arguments, 0) | |
return new Promise(function (resolve, reject) { | |
var cb = function (err, data) { | |
if (err) { | |
reject(err) | |
} else { |
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
# https://docs.npmjs.com/cli/install | |
# 1 | |
npm install <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>] | |
## Examples | |
npm install git+https://[email protected]/visionmedia/express.git | |
npm install git+https://[email protected]/visionmedia/express.git#branch | |
# 2 | |
npm install <githubname>/<githubrepo>[#<commit-ish>] |
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
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
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
// A typings definition of some telegram data structure | |
// author: Richard He<[email protected]> | |
// https://gist.github.com/richard1122/1eb54cd4e422aeb707718ab307decd34 | |
// see more detail: https://core.telegram.org/bots/api | |
declare namespace TL { | |
export interface IResponse<T> { | |
ok:boolean | |
result:T | |
} |
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
cd /usr/local/n/versions/node/7.0.0/ | |
sudo bin/npm i -g npm4 | |
cd /usr/local/bin/ | |
sudo mv npm4 npm |