Skip to content

Instantly share code, notes, and snippets.

@diem1
diem1 / app.js
Last active April 14, 2016 07:20
Очень быстрый старт с Ember.js
// 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" });
});
@diem1
diem1 / hello.html
Last active April 28, 2016 17:21
React Hello Word
<!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>
@diem1
diem1 / nodejs-legacy.txt
Last active May 5, 2016 14:46
NPM /usr/bin/env: ‘node’: No such file or directory
sudo apt-get install nodejs-legacy
@diem1
diem1 / some_js_file.js
Created June 22, 2016 09:31
Webpack config to support environment variables in JS app
var domain = process.env.DOMAIN || null;
console.log(domain);
@diem1
diem1 / component.js
Created August 5, 2016 13:00
взяття параметрів з адресної строки в react-router
ownerId = this.props.location.query.friend; // get params
ownerId = this.props.params.id;
@diem1
diem1 / 0_reuse_code.js
Created August 25, 2016 19:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console