Skip to content

Instantly share code, notes, and snippets.

Avatar

Kirill Gusyatin kikill95

View GitHub Profile
@kikill95
kikill95 / install.md
Created Oct 8, 2015 — forked from galulex/install.md
Ruby On Rails Ubuntu 15.04 install
View install.md

Developer libs

mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...

sudo apt-get install libxslt1-dev libxml2-dev libmagickwand-dev imagemagick libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar

Ruby

sudo apt-get install python-software-properties

sudo apt-add-repository ppa:brightbox/ruby-ng

View gulpfile.js
var gulp = require('gulp'),
concat = require('gulp-concat'),
ngAnnotate = require('gulp-ng-annotate'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
minifyCss = require('gulp-minify-css'),
del = require('del'),
imagemin = require('gulp-imagemin'),
sourcemaps = require('gulp-sourcemaps'),
@kikill95
kikill95 / basicPolymerElementDefinition.html
Last active Nov 6, 2015
Kirill G. - little dive into Polymer
View basicPolymerElementDefinition.html
<dom-module id="element-name">
<template>
<style>
/* CSS rules for your element */
</style>
<!-- local DOM for your element -->
<div>{{greeting}}</div> <!-- data bindings in local DOM -->
@kikill95
kikill95 / my-el-3.html
Created Nov 6, 2015
Kirill G. - little dive into Polymer
View my-el-3.html
<link rel="import"
href="../bower_components/polymer/polymer.html">
<link rel="import"
href="../bower_components/paper-fab/paper-fab.html">
<dom-module id="my-el-3">
<template>
<style>
@kikill95
kikill95 / my-el-2.html
Created Nov 6, 2015
Kirill G. - little dive into Polymer
View my-el-2.html
<link rel="import"
href="../bower_components/polymer/polymer.html">
<link rel="import"
href="../bower_components/paper-input/paper-input.html">
<link rel="import"
href="../bower_components/paper-spinner/paper-spinner.html">
<dom-module id="my-el-2">
<template>
@kikill95
kikill95 / my-el-0.html
Created Nov 6, 2015
Kirill G. - little dive into Polymer
View my-el-0.html
<link rel="import"
href="../bower_components/polymer/polymer.html">
<link rel="import"
href="../bower_components/iron-collapse/iron-collapse.html">
<link rel="import"
href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="my-el-3.html">
<dom-module id="my-el-0">
@kikill95
kikill95 / my-el-1.html
Created Nov 6, 2015
Kirill G. - little dive into Polymer
View my-el-1.html
<link rel="import"
href="../bower_components/polymer/polymer.html">
<dom-module id="my-el-1">
<template>
ha-ha
<b>{{text}}</b>
</template>
@kikill95
kikill95 / index.html
Created Nov 6, 2015
Kirill G. - little dive into Polymer
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Polymer Starter Kit</title>
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="test/my-el-0.html">
<link rel="import" href="test/my-el-1.html">
View promises.js
// create Promise
var promise = new Promise(function(fulfill, reject) {
if (/* condition */) { // for example, statusCode === 200 or something else, whatever
fulfill(/* success params */);
} else {
reject(/* fail params */);
}
});
// work with Promise
View promises_real_example.js
// real example
$ionicLoading.show();
API.post(url, postObject, headers).then(() => {
$state.go(homeStateName);
$ionicPopup.alert({
template: 'Some text'
});
}).then($ionicLoading.hide).catch($ionicLoading.hide);