Skip to content

Instantly share code, notes, and snippets.

View kikill95's full-sized avatar

Kirill Husiatyn kikill95

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

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

@kikill95
kikill95 / gulpfile.js
Last active October 20, 2015 10:41
Gulp. Set
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 November 6, 2015 11:11
Kirill G. - little dive into Polymer
<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 November 6, 2015 11:09
Kirill G. - little dive into Polymer
<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 November 6, 2015 11:10
Kirill G. - little dive into Polymer
<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 November 6, 2015 11:10
Kirill G. - little dive into Polymer
<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 November 6, 2015 11:11
Kirill G. - little dive into Polymer
<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 November 6, 2015 11:11
Kirill G. - little dive into Polymer
<!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">
@kikill95
kikill95 / promises.js
Last active March 15, 2023 17:55
Promises
// 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
// real example
$ionicLoading.show();
API.post(url, postObject, headers).then(() => {
$state.go(homeStateName);
$ionicPopup.alert({
template: 'Some text'
});
}).then($ionicLoading.hide).catch($ionicLoading.hide);