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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
ownerId = this.props.location.query.friend; // get params | |
ownerId = this.props.params.id; |
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
var domain = process.env.DOMAIN || null; | |
console.log(domain); |
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 install nodejs-legacy |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React JS</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | |
</head> | |
<body> |
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://stepansuvorov.com/blog/2014/04/%D0%BE%D1%87%D0%B5%D0%BD%D1%8C-%D0%B1%D1%8B%D1%81%D1%82%D1%80%D1%8B%D0%B9-%D1%81%D1%82%D0%B0%D1%80%D1%82-%D1%81-ember-js/ | |
App = Ember.Application.create({}); | |
App.ApplicationController = Ember.Controller.extend({ | |
message: 'А эту строку выведет в шаблон' | |
}); | |
App.Router.map(function() { | |
this.route("index", { path: "/" }); | |
this.route("list", { path: "/list" }); | |
}); | |
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
clientId = '' # ID додатка | |
clientSecret = '' # Захисний ключ | |
vkRequest = require 'request-json' | |
client = vkRequest.createClient 'https://oauth.vk.com/' | |
params = 'access_token' + | |
'?client_id=' + clientId + | |
'&client_secret=' + clientSecret + | |
'&grant_type=client_credentials' | |
data = |
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
n = Math.floor(Math.random() * 10 + 1) | |
console.log n |
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
var url = 'http://graph.facebook.com/517267866/?fields=picture'; | |
var http = require('http'); | |
http.get(url, function(res){ | |
var body = ''; | |
res.on('data', function(chunk){ | |
body += chunk; | |
}); |
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
var fs = require('fs'), | |
request = require('request'); | |
request.get('http://res.cloudinary.com/hyper1/video/upload/v1453822340/blame_khmv2j.mp3').on('error', function(err) { | |
// handle error | |
}).pipe(fs.createWriteStream('2.mp3')); |
NewerOlder