Skip to content

Instantly share code, notes, and snippets.

💣
ReactNative

Andrey Katrusha kaflan

View GitHub Profile
View auth service.ts
import {Injectable} from '@angular/core';
import {Router, CanActivate} from '@angular/router';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {Observable} from 'rxjs/Observable';
import {User} from '../../models/user.interface';
import {Users} from '../../Users.Mock';
import { SaveToStorageService} from '../storage/save-to-storage.service';
@Injectable()
export class AuthService implements CanActivate {
View route.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import {AuthComponent} from './auth/auth.component';
import {BlocksViewComponent} from './blocks-view/blocks-view.component';
import {ImageUploadComponent} from './image-upload/image-upload.component';
import {TableViewComponent} from './table-view/table-view.component';
import {AuthGuardService} from './services/auth/auth-guard-service.service';
import {AuthService} from './services/auth/auth-service.service';
View webpack.config.js
var webpack = require('webpack');
var wpServer = require('webpack-dev-server');
module.exports = {
context: __dirname + '/app',
entry: [
'./app.ts',
"webpack-dev-server/client?http://localhost:8080"
],
output: {
View sinple.wufoo.html
<div id="wufoo-q1m2c1ph038hxkv"> </div>
<script type="text/javascript">
var q1m2c1ph038hxkv;
(function(d, t) {
var s = d.createElement(t),
options = {
'userName': 'nashaleptachallenge',
'formHash': 'q1m2c1ph038hxkv',
'autoResize': true,
'height': '820',
View webpack.config.js
var path = require('path');
var webpack = require('webpack');
var ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const NODE_ENV = process.env.NODE_ENV || 'development';
module.exports = {
// context: __dirname + '/public/scripts/app',
entry: {
bundle: __dirname + '/public/scripts/app/index.js'
},
output: {
View err.js
Warning: Task "jshint:all" failed. Use --force to continue
grunt -serve
Loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'karma'
View suffix .txt
cat /var/log/Xorg.0.log
[ 27.674]
X.Org X Server 1.17.4
Release Date: 2015-10-28
[ 27.674] X Protocol Version 11, Revision 0
[ 27.674] Build Operating System: Linux 4.2.5-1-ARCH x86_64
[ 27.674] Current Operating System: Linux mangaro 4.1.15-1-MANJARO #1 SMP PREEMPT Tue Dec 15 07:48:44 UTC 2015 x86_64
[ 27.674] Kernel command line: BOOT_IMAGE=/vmlinuz-4.1-x86_64 root=UUID=968042fa-c73a-4e8d-a0e2-f51f6d7c1008 rw resume=UUID=4a3241f0-099d-406a-8f34-ccb823cdfaa0 quiet splash
[ 27.674] Build Date: 01 November 2015 10:36:50AM
[ 27.674]
@kaflan
kaflan / index.logarifms.js
Created Nov 15, 2015
Алгоритмы для себя
View index.logarifms.js
оценка сложности алгоритма
log
логорифм где делим пополам, сортировка
фаториал !n
если у тебя есть 4 элемента - яблоко, банан, груша, апельсин, и тебе их нада поставить на 4 места, то:
на первое место ты можешь поставить любой из 4 елеметов
таким образом у тебя есть 4 базовых комбинации
для каждой останется по 3 эт\лемента
то есть если ты на первое место поставил яблоко, то останется для этой комбинации 3 элемента отличных от яблока
и так для каждой
@kaflan
kaflan / index.js
Created Oct 25, 2015
Задания номер 2
View index.js
//Задание 1. Таблицы умножения
function generateTable(w,h) {
var table = '';
for (var i = 1; i <= w; i++) {
for (var j = 1; j <= h; j++) {
var result = i * j;
table += (result < 10 ? ' ' : ' ') + result;
}
table += '\n';
}
@kaflan
kaflan / app.js
Created Jul 12, 2015
заебался
View app.js
var http = require('http');
var url = require('url');
var _ = require('lodash');
var port = 20007;
var newUser = '';
var list = {
'1': {id: '1', name: 'Illya Klymov', phone: '+380504020799', role: 'Administrator'},
'2': {id: '2', name: 'Ivanov Ivan', phone: '+380670000002', role: 'Student', strikes: 1},
'3': {id: '3', name: 'Petrov Petr', phone: '+380670000001', role: 'Support', location: 'Kiev'},
'max': 4
You can’t perform that action at this time.