text:
<repo_name>barld/js-tools<file_sep>/Ajax/Search/PHP/add.php

back
<form method="POST">
    naam
    <input type="text" id="naam" name="naam"/>
    <input type="submit">
</form>

<?php
/**
 * Created by JetBrains PhpStorm.
 * User: barld
 * Date: 7-8-13
 * Time: 14:51
 * To change this template use File | Settings | File Templates.
 */
if(isset($_POST['naam']))
{
    include_once("class/mysql.class.php");
    $insert = new Mysql();
    $insert->insert("name", array("NULL", ":name"));
    $insert->bind(array(":name"=>$_POST['naam']));
    $insert->execute();
}
?>

<file_sep>/Rock-Paper-Scissors/readme.md
een toel die je maakt bij codeacademy
<file_sep>/README.md
js-tools
========
<file_sep>/Ajax/Search/JS/search.js
function Search()
{
    this.zoek = function()
    {
        var xmlhttp;

        var search = $('#search').val();

        xmlhttp=new XMLHttpRequest();

        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                $("ol").html(xmlhttp.responseText);
            }
        }
        xmlhttp.open("POST","PHP/search.php",true);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        xmlhttp.send("search="+search);
    };
}<file_sep>/Ajax/test.php
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: barld
 * Date: 7-8-13
 * Time: 9:57
 * To change this template use File | Settings | File Templates.
 */
echo $_POST['num'];
<file_sep>/Calculator/CalculatorForm.css
#container{
    width: 220px;
}
input[type=button], input[type=submit]
{
    width: 40px;
    height: 40px;
    margin-top: 3px;
}

.number{
    background-color: blue;
}
.number:hover{
    background-color: lightblue
}
.del{
    background: url(./img/backspace.png) no-repeat center;
}
#display_sum, #display_answer
{
    width: 210px;
    height: 25px;
    font-size: 18px;
    margin-bottom: 7px;
}<file_sep>/Ajax/search/PHP/search.php
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: barld
 * Date: 7-8-13
 * Time: 11:35
 * To change this template use File | Settings | File Templates.
 */

if(!isset($_POST['search'])){
//niks verstuurd
    echo "geen resultaat";
}
elseif($_POST['search']!=""){
    include_once("class/search_mysql.class.php");

    $zoek = new searchMysql();

    $resultaaten = $zoek->search(array("id", "name"), array('name'), "name", $_POST['search']);

    //pak array uit en maak er een lijstje van
    foreach($resultaaten as $resultaat)
    {
        echo "
".$resultaat['name']."
", PHP_EOL;
    }
    if(empty($resultaaten))
    {
        echo "geen resultaat";
    }
}
else{echo "geen resultaat";}

<file_sep>/Calculator/Calculator.js
/**
 * User: barld
 * Date: 10-7-13
 * Time: 14:15
 */
String.prototype.placeAt=function(index, character) {
    return this.substr(0, index) + character + this.substr(index);
}

function Calculator()
{

    /*
        *   instaleer en zet de html objecten die gebruikt worden
        *
        *   @valeu : this.display_sum
        *   @description : invoer veld waar de user de formule invoerd
        *
        *   @valeu : this.display_answer
        *   @description : in dit gedisabled invoer veld word het antwoord getoond
    */

    this.display_sum = $('#display_sum');
    this.disolay_answer = $('#display_answer');

   this.Answeregiven = false

    this.getDisplay = function(field)
    {
        if(field === "sum")
        {
            return this.display_sum.val();
        }else if(field === "answer")
        {
            return this.disolay_answer.val();
        }
        return false
    };

    this.setDisplay = function(value, field)
    {
        if(field === "sum")
        {
            this.display_sum.val(value);
        }else if(field === "answer")
        {
            this.disolay_answer.val(value);
        }
        return true;
    };

    // functie om in display getallen en symbolen toe te voegen.
    this.addCharter = function(number)
    {
        var list = ['*', '/', '+', '-'];
        if(this.Answeregiven && list.indexOf(number) != -1)
        {
            this.setDisplay('Ans', "sum");
        }
        if(this.getDisplay("sum").length<20)
        {
            var firstnumber = this.getDisplay("sum");
            //kijk waar de cursor is om het teken op de juiste plaats te plaatsen
            var placeCursor = this.display_sum.prop("selectionStart");
            this.setDisplay(firstnumber.placeAt(placeCursor, number), "sum");
            //hier een een dubele regel waar de selectie moet beginnen en eindigen deze is gelijk zodat er niks wordt geselecteerd
            // +1 zodat de cursor er wel achter staat
            this.display_sum.prop("selectionStart", placeCursor+1);
            this.display_sum.prop("selectionEnd", placeCursor+1);
            this.Answeregiven = false;
        }
    };

    this.calculate = function()
    {
        var display = this.getDisplay("sum");
        // vervang stukken string voor een cijfer
        display = this.valueReplace(display);

        if(true)// moet controlle functie komen of er wel een valide string is "display != parseFloat(display)" werkt niet altijd niet bij langere cijfers als pi
        {
            var antwoord = eval(display);
            this.setDisplay(antwoord, "answer");
            this.Answeregiven = true;
            return true;
        }
        alert("je moet het wel goed invullen");
        return false;
    };

    this.backspace = function(part)
    {
        if(part == "ALL")
        {
            this.setDisplay("", "sum");
        }
        else
        {
            var value = this.getDisplay('sum');
            this.setDisplay(value.substr(0, value.length-1), "sum");
        }
    };

    this.valueReplace = function(string)//moet netter gemaakt worden voor geval dat er nog veel functies voor vervangen bijkomen
    {
        var back = string.replace(/PI/gi, Math.PI);//vervangt nu ok meerdere PI's

        //worteltrekken
        if(back.match("sqrt\\((.*)\\)"))
        {
            back = back.replace(back.match("sqrt\\((.*)\\)")[0] , Math.sqrt(back.match("sqrt\\((.*)\\)")[1]));
        }

        back = back.replace(/Ans/gi, this.getDisplay("answer"));

        return back;
    };

};<file_sep>/Ajax/search/PHP/class/search_mysql.class.php
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: barld
 * Date: 7-8-13
 * Time: 13:07
 * To change this template use File | Settings | File Templates.
 */

class searchMysql
{
    private $_database;

    public function __construct()
    {
        //er wordt gezorgd dat er verbinding wordt gemaakt met de database zodat daar zoekacties kunnen worden uitgevoerd
        include_once('mysql.class.php');
        $this->_database = new Mysql();
    }

    public function search($atribuuten, $entiteitent, $var, $val)
    {
        $where = array($var." LIKE :".$var);
        $this->_database->select($atribuuten, $entiteitent, $where);
        $this->_database->bind(array(":".$var=>"%".$val."%"));
        $this->_database->execute();
        return $this->_database->fetchAsoc();
    }
}<file_sep>/indexlist.js
/**
 * Created with JetBrains PhpStorm.
 * User: barld
 * Date: 10-7-13
 * Time: 17:09
 * To change this template use File | Settings | File Templates.
 */

var makeList = function(list)
{
    var string = "
";
    for(test in list)
    {
        string += "
"+test+"
";
    }
    string +="
";
    return string;
}
<file_sep>/Ajax/search/PHP/class/mysql.class.php
<?php

class Mysql
{
    protected $_verbinding;
    protected $_quiry;

    public function __construct()
    {
        $this->maakverbinding();
        return true;
    }

    //eigenlijk een construct maar kan ook tussendoor worden als de verbinding wordt gesloten
    public function maakverbinding()
    {
        $db = new PDO('mysql:host=localhost;dbname=searchnames;charset=utf-8', 'root', '');
        //emulatie staat uit voor de veiligheid
        $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
        $this->_verbinding = $db;
        return true;
    }

    public function sluitverbinding()
    {
        $this->_verbinding = NULL;
        return true;
    }

    public function select($atribuuten, $entiteiten, $where= array("'a'='a'"))
    {
        $sql = "SELECT";

        foreach($atribuuten as $atribuut)
        {
            $sql .= " ".$atribuut.",";
        }

        $sql = substr_replace($sql, "", -1);

        $sql .= " FROM";

        foreach($entiteiten as $entiteit)
        {
            $sql .= " ".$entiteit.",";
        }

        $sql = substr_replace($sql, "", -1);

        $sql .= " WHERE";

        foreach($where as $waarom)
        {
            $sql .= " ".$waarom;
        }

        $this->_quiry = $this->_verbinding->prepare($sql);
    }

    public function insert($entiteit, $set)
    {
        $sql= "INSERT INTO ";
        $sql .= $entiteit." VALUES (";

        foreach($set as $value)
        {
            $sql .= " ".$value.",";
        }
        $sql = substr_replace($sql, "", -1);
        $sql .= " )";

        $this->_quiry = $this->_verbinding->prepare($sql);
    }

    public function update($entiteit, $set, $where)
    {
        $sql= "UPDATE ";
        $sql .= $entiteit." SET ";

        foreach($set as $variable=>$value)
        {
            $sql .= " ".$variable."=".$value.",";
        }
        $sql = substr_replace($sql, "", -1);

        $sql .= " WHERE";

        foreach($where as $waarom)
        {
            $sql .= " ".$waarom;
        }

        $this->_quiry = $this->_verbinding->prepare($sql);
    }

    public function delete($entiteit, $where)
    {
        $sql = "DELETE FROM ".$entiteit." WHERE ";
        $sql .= $where;

        $this->_quiry = $this->_verbinding->prepare($sql);
    }

    public function bind($binden = array())
    {
        foreach($binden as $pdovar=>$pdoinh)
        {
            $this->_quiry->bindParam($pdovar, $pdoinh);
        }
    }

    public function execute()
    {
        $this->_quiry->execute();
    }

    public function fetchAsoc()
    {
        return $this->_quiry->fetchAll(PDO::FETCH_ASSOC);
    }
}
?><file_sep>/Balans/main.js
/**
 * Created with JetBrains PhpStorm.
 * User: barld
 * Date: 3-8-13
 * Time: 22:22
 * To change this template use File | Settings | File Templates.
 */

function Balans()
{

    this.rotation = 0;

    this.getVal = function(side, propertie)
    {
        return $('#'+propertie+'-'+side).val();
    };

    this.rotate = function()
    {
        $("#container #balans").rotate({animateTo:this.rotation});
    };

    this.turn = function(side)
    {
        switch (side)
        {
            case "left":
                this.rotation -= 15;
                break;
            case "right":
                this.rotation += 15;
                break;
            case "reset":
                this.rotation = 0;
                break;
            default :
                console.log("error");
        }
        this.rotate();
    };

    this.sideLength = function(side)
    {
        $('#balans-'+side).width(this.getVal(side , 'length'));
        //reset
        $('#balans-left').css('margin-left', 0);
        $('#balans-right').css('margin-right', 0);
        /*if(this.getVal('left') + this.getVal('right') < 100)
        {
            console.log('lager dan 100');
            if(this.getVal('left') < this.getVal('right'))
            {
                $('#balans-left').css('margin-left', this.getVal('right')- this.getVal('left'));
            }

        }*/
        if(this.getVal('left', 'length') < this.getVal('right', 'length'))
        {
            $('#balans-left').css('margin-left', this.getVal('right', 'length')- this.getVal('left', 'length'));
        } else if(this.getVal('left', 'length') > this.getVal('right', 'length'))
        {
            $('#balans-right').css('margin-right', this.getVal('left', 'length') - this.getVal('right', 'length'));
        }

        this.calculateBalans = function()
        {
            if(this.getVal('left', 'kracht')*this.getVal('left', 'length') > this.getVal('right', 'kracht')*this.getVal('right', 'length'))
            {
                this.rotation = -20;
                this.rotate();
            }
            else if(this.getVal('left', 'kracht')*this.getVal('left', 'length') == this.getVal('right', 'kracht')*this.getVal('right', 'length'))
            {
                this.rotation = 0;
                this.rotate();
            }
            else if(this.getVal('left', 'kracht')*this.getVal('left', 'length') < this.getVal('right', 'kracht')*this.getVal('right', 'length'))
            {
                this.rotation = 20;
                this.rotate();
            }
        }
    };
}

languages: Markdown JavaScript CSS PHP

repo_name: barld/js-tools


text:
<file_sep>export class WorkExperinceModel {
    year: string;
    companyName: string;
    city: string;
    description: string;
}<file_sep>import { Component, OnInit, EventEmitter, Output } from "@angular/core";
import { EducationModel } from "../../models/education-model";
import { WorkExperinceModel } from "../../models/work-experince-model";
import { ComputerSkillModel } from "../../models/computer-skill-model";
import { ProjectModel } from "../../models/project-model";
import * as _ from "lodash";
import { Router } from "@angular/router";

@Component({
  selector: "app-resume",
  templateUrl: "./resume.component.html",
  styleUrls: ["./resume.component.css"],
})
export class ResumeComponent implements OnInit {
  mainComputerSkills = [
    "Javascript",
    "Typescript",
    "ES6",
    "Vue.js",
    "Angular 2+",
    "HTML",
    "CSS",
    "Sass",
    "Bootstrap",
    "Angular Material",
    "GraphQL",
    "Functional Programming",
    "JAVA-Spring Boot",
    "OOP",
    "Microservice Architecture",
    "Postman",
    "Git",
    "SourceTree",
  ];

  educations = new Array<EducationModel>();
  workExperiences = new Array<WorkExperinceModel>();
  projects = new Array<ProjectModel>();

  educationModel = new EducationModel();
  workExperinceModel = new WorkExperinceModel();
  computerSkillModel = new ComputerSkillModel();
  projectModel = new ProjectModel();

  constructor(private router: Router) {}

  ngOnInit() {
    this.educationModel.city = "İstanbul";
    this.educationModel.schoolName = "DOGUS UNIVERSITY";
    this.educationModel.year = "2013 - 2018";
    this.educationModel.description =
      "Bachelor's Degree in Computer Engineering (Double Major)";

    this.educations.push(_.cloneDeep(this.educationModel));

    this.educationModel.city = "İstanbul";
    this.educationModel.schoolName = "DOGUS UNIVERSITY";
    this.educationModel.year = "2013 - 2018";
    this.educationModel.description =
      "Bachelor's Degree in  Electronics & Communication Engineering";

    this.educations.push(_.cloneDeep(this.educationModel));

    this.workExperinceModel.year = "2019 - Present";
    this.workExperinceModel.city = "İstanbul";
    this.workExperinceModel.companyName = "HUAWEI Turkey R & D Center";
    this.workExperinceModel.description =
      "Frontend Developer - Internal project for Huawei employees.";

    this.workExperiences.push(_.cloneDeep(this.workExperinceModel));

    this.workExperinceModel.year = "2017 - 2019";
    this.workExperinceModel.city = "İstanbul";
    this.workExperinceModel.companyName =
      "TCM BİLİ<NAME> A.Ş";
    this.workExperinceModel.description =
      "Software Developer - Real Estate Management Project for Rönesans Gayrimenkul Yatırım A.Ş";

    this.workExperiences.push(_.cloneDeep(this.workExperinceModel));

    this.workExperinceModel.year = "2017 - (1 Month)";
    this.workExperinceModel.city = "İstanbul";
    this.workExperinceModel.companyName = "TÜRK TELEKOMÜNİKASYON A.Ş";
    this.workExperinceModel.description =
      "Compulsory intern for Computer Engineering";

    this.workExperiences.push(_.cloneDeep(this.workExperinceModel));

    this.workExperinceModel.year = "2017 - (1 Month)";
    this.workExperinceModel.city = "İstanbul";
    this.workExperinceModel.companyName = "CEVİZ BİLGİ TEKNOLOJİLERİ";
    this.workExperinceModel.description =
      "Compulsory intern for Computer Engineering";

    this.workExperiences.push(_.cloneDeep(this.workExperinceModel));

    this.workExperinceModel.year = "2017 - (1 Month)";
    this.workExperinceModel.city = "İstanbul";
    this.workExperinceModel.companyName = "QUASYS BİLİŞİM TEKNOLOJİLERİ";
    this.workExperinceModel.description =
      "Compulsory intern for Computer Engineering";

    this.workExperiences.push(_.cloneDeep(this.workExperinceModel));

    this.computerSkillModel.mainSkills = this.mainComputerSkills;

    this.projectModel.projectName = "Huawei ISDP Workorder project";
    this.projectModel.usedTechnologies = "Vue.js, Aurora UI, JAVA-Spring Boot";
    this.projectModel.link = "http://www.fatihkucuk.blog/my-works";
    this.projectModel.hasOutsourceLink = false;

    this.projects.push(_.cloneDeep(this.projectModel));

    this.projectModel.projectName =
      "Real Estate Management Project for Rönesans Gayrimenkul Yatırım A.Ş";
    this.projectModel.usedTechnologies =
      "Angular 2, Bootstrap, Angular Material, .NET C# Web API 2, MS-SQL";
    this.projectModel.link = "http://www.fatihkucuk.blog/my-works";
    this.projectModel.hasOutsourceLink = false;

    this.projects.push(_.cloneDeep(this.projectModel));

    this.projectModel.projectName = "<NAME>";
    this.projectModel.usedTechnologies =
      "Angular 6, Bootstrap, .NET C# Web API 2";
    this.projectModel.link = "https://www.aksadar.com/";
    this.projectModel.hasOutsourceLink = true;

    this.projects.push(_.cloneDeep(this.projectModel));

    this.projectModel.projectName =
      "Single Page Social Web-Site for University Students (Graduation Project)";
    this.projectModel.usedTechnologies =
      "Angular 2, Web API 2, MS-SQL, HTML, CSS, Bootstrap";
    this.projectModel.link = "";

    this.projects.push(_.cloneDeep(this.projectModel));

    this.projectModel.projectName = "Voice Controlled Smart Car";
    this.projectModel.usedTechnologies = "Arduino Uno";
    this.projectModel.link = "https://www.youtube.com/watch?v=jgmUjGIblGQ";
    this.projectModel.hasOutsourceLink = true;

    this.projects.push(_.cloneDeep(this.projectModel));

    this.projectModel.projectName = "Light Sensitive LED Strip";
    this.projectModel.usedTechnologies = "Arduino Uno";
    this.projectModel.link = "https://www.youtube.com/watch?v=SzbzpB5rxJo";
    this.projectModel.hasOutsourceLink = true;

    this.projects.push(_.cloneDeep(this.projectModel));
  }
}
<file_sep>export enum PageMode {
  NONE = -1,
  AboutMe = 0,
  Resume = 1,
  Works = 2,
  Blog = 3,
  Contact = 4
}
<file_sep>export class ComputerSkillModel {
  mainSkills: string[];
}
<file_sep>import {
  trigger,
  animate,
  style,
  group,
  animateChild,
  query,
  stagger,
  transition
} from "@angular/animations";

export const routerTransition = trigger("routerTransition", [
  transition("* <=> *", [
    query(":enter, :leave", style({ position: "absolute", width: "100%" }), {
      optional: true
    }),
    group([
      query(
        ":enter",
        [
          style({ transform: "translateX(-50%)", opacity: 0.2 }),
          animate(
            "0.5s ease-in-out",
            style({ transform: "translateX(0%)", opacity: 1 })
          )
        ],
        { optional: true }
      ),
      query(
        ":leave",
        [
          style({ transform: "translateX(0%)" }),
          animate(
            "0.5s ease-in-out",
            style({ transform: "translateX(-40%)", opacity: 0.2 })
          )
        ],
        { optional: true }
      )
    ])
  ])
]);
<file_sep>import { Component, OnInit } from "@angular/core";
import { MatDialog } from "../../../../node_modules/@angular/material";
import { MyWorksPopUpComponent } from "../my-works-pop-up/my-works-pop-up.component";
import { MyWorksModel } from "../../models/my-works-model";
import * as _ from "lodash";

@Component({
  selector: "app-my-works",
  templateUrl: "./my-works.component.html",
  styleUrls: ["./my-works.component.css"]
})
export class MyWorksComponent implements OnInit {
  myWorkModel = new MyWorksModel();
  myWorks = new Array<MyWorksModel>();
  displayImageIcon: boolean = false;
  opacity: number = 0.6;
  constructor(public dialog: MatDialog) {}

  ngOnInit() {
    this.myWorkModel.name = "<NAME>-1";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/pilotaj-1.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));

    this.myWorkModel.name = "<NAME>anı-2";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/pilotaj-2.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));

    this.myWorkModel.name = "<NAME>-1";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/Marka-1.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));

    this.myWorkModel.name = "<NAME>-2";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/Marka-2.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));

    this.myWorkModel.name = "<NAME>-3";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/Marka-3.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));

    this.myWorkModel.name = "<NAME>";
    this.myWorkModel.description = "";
    this.myWorkModel.imagePath = "./assets/my-works-images/Marka-4.gif";
    this.myWorks.push(_.cloneDeep(this.myWorkModel));
  }
  openDialog(imgPath: string): void {
    const dialogRef = this.dialog.open(MyWorksPopUpComponent, {
      width: "250px",
      data: imgPath
    });

    dialogRef.afterClosed().subscribe(result => {});
  }

  imageHovered() {
    this.displayImageIcon = !this.displayImageIcon;
    if (this.displayImageIcon) {
      this.opacity = 1;
    } else {
      this.opacity = 0.6;
    }
  }
}
<file_sep>import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { Routes, RouterModule } from "../../node_modules/@angular/router";
import { DashboardComponent } from "./components/dashboard/dashboard.component";
import { AboutMeComponent } from "./components/about-me/about-me.component";
import { ResumeComponent } from "./components/resume/resume.component";
import { ContactComponent } from "./components/contact/contact.component";
import { NotFoundComponent } from "./components/not-found/not-found.component";

const routes: Routes = [
  {
    path: "",
    redirectTo: "/about-me",
    pathMatch: "full",
    data: { state: "/about-me" },
  },
  {
    path: "",
    component: DashboardComponent,
    children: [
      { path: "", pathMatch: "full", redirectTo: "about-me" },
      {
        path: "about-me",
        component: AboutMeComponent,
        data: { state: "about-me" },
      },
      {
        path: "my-resume",
        component: ResumeComponent,
        data: { state: "my-resume" },
      },
      {
        path: "contact",
        component: ContactComponent,
        data: { state: "contact" },
      },
    ],
  },
  { path: "404", component: NotFoundComponent },
  { path: "**", redirectTo: "/404" },
];

@NgModule({
  imports: [CommonModule, RouterModule.forRoot(routes, { useHash: true })],
  declarations: [],
  exports: [RouterModule],
})
export class AppRoutingModule {}
<file_sep>export class ProjectModel {
  projectName: string;
  usedTechnologies: string;
  link: string;
  hasOutsourceLink: boolean;
}
<file_sep># My Portfolio
[Demo](https://fatihkucuk.github.io/fatihkucuk/)
<file_sep>export class EducationModel {
    year: string;
    schoolName: string;
    city: string;
    description: string;
}<file_sep>export class ProfileModel{
    name: string;
    title: string;
    company: string;
    profilePhoto: string;
    linkedin: string;
    github: string;
}<file_sep>import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Injectable } from '@angular/core';
import { AppComponent } from './app.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { ProfileComponent } from './components/profile/profile.component';
import { NavigationBarComponent } from './components/navigation-bar/navigation-bar.component';
import { ContentComponent } from './components/content/content.component';
import { AboutMeComponent } from './components/about-me/about-me.component';
import { ResumeComponent } from './components/resume/resume.component';
import { AppRoutingModule } from './/app-routing.module';
import { MyWorksComponent } from './components/my-works/my-works.component';
import { AngularFontAwesomeModule } from 'angular-font-awesome';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatDialogModule, MatTooltipModule } from '@angular/material';
import { MyWorksPopUpComponent } from './components/my-works-pop-up/my-works-pop-up.component'
import { FormsModule, ReactiveFormsModule } from '../../node_modules/@angular/forms';
import { CommonModule } from '../../node_modules/@angular/common';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { ContactComponent } from './components/contact/contact.component';

@NgModule({
  declarations: [
    AppComponent,
    DashboardComponent,
    ProfileComponent,
    NavigationBarComponent,
    ContentComponent,
    AboutMeComponent,
    ResumeComponent,
    MyWorksComponent,
    MyWorksPopUpComponent,
    NotFoundComponent,
    ContactComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    ReactiveFormsModule,
    CommonModule,
    AppRoutingModule,
    AngularFontAwesomeModule,
    BrowserAnimationsModule,
    MatDialogModule,
    MatTooltipModule
  ],
  entryComponents: [
    MyWorksComponent,
    MyWorksPopUpComponent
  ],
  exports: [
    MyWorksComponent,
    MyWorksPopUpComponent
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
<file_sep>import { Component, OnInit, Output, EventEmitter } from "@angular/core";
import { ProfileModel } from "../../models/profile-model";
import { Router } from "../../../../node_modules/@angular/router";

@Component({
  selector: "app-profile",
  templateUrl: "./profile.component.html",
  styleUrls: ["./profile.component.css"],
})
export class ProfileComponent implements OnInit {
  profileModel = new ProfileModel();
  downloadURL: string;
  cvLink: string =
    "https://firebasestorage.googleapis.com/v0/b/resume-web-site.appspot.com/o/FATIH_KUCUK_38884682074_CV%20(1)-d%C3%B6n%C3%BC%C5%9Ft%C3%BCr%C3%BCld%C3%BC.pdf?alt=media&token=<KEY>";
  cvHovered: boolean = false;
  contactMeHovered: boolean = false;
  constructor(private router: Router) {}

  ngOnInit() {
    this.profileModel.name = "<NAME>";
    this.profileModel.title = "Software Developer";
    this.profileModel.company = "Huawei";
    this.profileModel.linkedin =
      "https://www.linkedin.com/in/fatih-küçük-2b546812b";
    this.profileModel.github = "https://github.com/fatihkucuk";
  }

  contactMeClicked() {
    this.router.navigateByUrl("contact", { replaceUrl: true });
  }

  downloadCvClicked() {
    window.open(this.cvLink);
  }
}
<file_sep>import { Component, OnInit, Output, EventEmitter, Input } from "@angular/core";
import {
  Router,
  NavigationEnd,
} from "../../../../node_modules/@angular/router";
import { PageMode } from "src/app/enums/PageMode";

@Component({
  selector: "app-navigation-bar",
  templateUrl: "./navigation-bar.component.html",
  styleUrls: ["./navigation-bar.component.css"],
})
export class NavigationBarComponent implements OnInit {
  pageMode: PageMode = PageMode.AboutMe;

  constructor(private router: Router) {
    router.events.subscribe((navigationEvent) => {
      if (navigationEvent instanceof NavigationEnd) {
        const url = navigationEvent.url;
        if (url) {
          if (url === "/about-me") {
            this.pageMode = PageMode.AboutMe;
          } else if (url === "/my-resume") {
            this.pageMode = PageMode.Resume;
          } else if (url === "/my-works") {
            this.pageMode = PageMode.Works;
          } else if (url === "/contact") {
            this.pageMode = PageMode.Contact;
          }
        }
      }
    });
  }

  ngOnInit() {}

  itemClicked(clickedItem) {
    if (clickedItem) {
      if (clickedItem === "aboutMeClicked") {
        this.router.navigateByUrl("about-me", { replaceUrl: true });
      }
      if (clickedItem === "resumeClicked") {
        this.router.navigateByUrl("my-resume", { replaceUrl: true });
      }
      if (clickedItem === "contactClicked") {
        this.router.navigateByUrl("contact", { replaceUrl: true });
      }
      if (this.isMobileDevice()) this.scrollBottom();
    }
  }

  isMobileDevice() {
    return window.screen.width <= 767;
  }

  scrollBottom() {
    window.scrollTo(0, document.body.scrollHeight);
  }
}
<file_sep>export class MyWorksModel {
    name: string;
    imagePath: string;
    description: string;
    displayImageIcon: boolean = false;
}

branch_name: refs/heads/master

languages: Markdown TypeScript

repo_language: Markdown

repo_name: fatihkucuk/fatihkucuk


text:
<repo_name>datthan1576/methodDikhotimia<file_sep>/Dikhotomia.cpp

#include <iostream>
#include<math.h>

struct Index
{
    double a3;
    double a2;
    double a1;
    double a0;
};//структура коэффициентов функции
struct Interval
{
    double a;
    double b;
};
Index setIndex()
{
    Index tempID ;
    std::cout << "Function: y=a3*x^3+a2*x^2+a1*x+a0" << std::endl;
    std::cout << "Enter a3,a2,a1,a0 :"<<std::endl;
    std::cin >> tempID.a3 >> tempID.a2 >> tempID.a1 >> tempID.a0;
    return tempID;
}
Interval setInterval()
{
    Interval tempIn;
    std::cout << "\tInterval [a,b]" << std::endl;
    std::cout << "Enter a:";
    std::cin>> tempIn.a;
    std::cout << "Enter b:";
    std::cin >> tempIn.b;
    return tempIn;
}
double f(double x,struct Index ind)
{
    return (ind.a3*x * x * x +ind.a2 * x * x + ind.a1*x+ind.a0);
}//функции y
void swap(double &a,double& c,double &b)
{
    a = c;
    c = (a + b)/2;
}
void findRoot(double &a,double &b,Index &ind)
{
    double c{ (a + b) / 2 };
    static int iterations{};
    while (abs(a - b) > 0.001)
    {
        if (f(a, ind) * f(c, ind) > 0)
        {
            swap(a, c, b);
        }
        else
        {
            swap(b, c, a);
        }
        iterations++;
    }

    if (abs(f(c, ind)) >0.1 )
    {
        std::cout << "No roots!!";
    }
    else
    {
        std::cout << "Number of iterations =" << iterations << std::endl;
        std::cout << "Root =" << c;
    }
}
int main()
{
    Index index = setIndex();
    Interval interval = setInterval();
    findRoot(interval.a,interval.b,index);
    return 0;
}


text:
<repo_name>shobivijay90/Speaker-Registrations<file_sep>/insert.php

<?php
// Establishing Connection with Server
$connection = mysqli_connect("localhost:3306", "health4t_regis", "goh4tw2019") ;
// checking connection
if (!$connection)
  {
  echo "Not connected to server";
  }
  if(!mysqli_select_db($connection, 'health4t_registration')){
      echo 'Database not selected';
  }
// Fetching variables of the form which travels in URL
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$title_department = $_POST['title_department'];
$institution = $_POST['institution'];
$email = $_POST['email'];
$phonenumber = $_POST['phonenumber'];
$specialty = $_POST['specialty'];
$topic = $_POST['topic'];
$audience = $_POST['audience'];
$language = $_POST['language'];
$available_date = $_POST['available_date'];
$start_time = $_POST['start_time'];
$end_time = $_POST['end_time'];
$preferred_date1 = $_POST['preferred_date1'];
$preferred_date2 = $_POST['preferred_date2'];
$preferred_date3 = $_POST['preferred_date3'];
$docusign = $_POST['docusign'];

//inserting data to php form
$sql="INSERT INTO speaker_registrations (firstname, lastname, title_department, institution, email, phonenumber, specialty, topic, audience, language, available_date, start_time, end_time, preferred_date1, preferred_date2, preferred_date3, docusign)
VALUES
('$firstname', '$lastname', '$title_department', '$institution', '$email', '$phonenumber', '$specialty', '$topic', '$audience', '$language', '$available_date', '$start_time', '$end_time', '$preferred_date1', '$preferred_date2', '$preferred_date3', '$docusign')";

$result=mysqli_query($connection,$sql);

//checking insertion
if($result){

$to = $email;
$subject =  "Health4TheWorld - Session Confirmation";

$message = '';
$message .= '
Hi '. $firstname .' '. $lastname .',
';
$message .= '
Thanks for signing up for Health4theworld International GrandRounds. We value your participation in this global education mission.
';
$message .= '
Please see your session details below:
';
$message .= '
';
$message .= "
Speaker Name: 	". $firstname .' '. $lastname ."
";
$message .= "
Topic: 	" . $topic . "
";
$message .= "
Specialty: 	". $specialty . "
";
$message .= "
Session Date: 	" . $available_date . "
";
$message .= "
Start Time: 	" . $start_time . "
";
$message .= "
End Time: 	" . $end_time . "
";
$message .= "
";
$message .= '
Thanks,
';
$message .= '
Health4TheWorld Team.
';
$message .= '
Please reply to this email, If you want to cancel this session.
';
$message .= "";

// Set content-type header for sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// Additional headers
$fromName= "Health4TheWorld Academy";
$from= "<EMAIL>";
$headers .= 'From: '.$fromName.'<'.$from.'>' . "\r\n";
$headers .= 'Cc: <EMAIL>,<EMAIL>,<EMAIL>' . "\r\n";
//$headers .= 'Bcc: <EMAIL>' . "\r\n";

mail($to, $subject, $message, $headers);

$link = "https://health4theworld.org/academy/wp-content/themes/wplms/Thankyou.php";
header("location:$link");

}
else {
echo "Registration failed! Please try again later.";
}

?>

repo_language: PHP


text:
<file_sep>[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
rncryptor = "==3.2.0"
bpylist = "==0.1.4"
click = "==6.7"
pyqrcode = "==1.2.1"
pycryptodome = "==3.9.1"

[requires]
python_version = "3.7"

repo_language: TOML

repo_name: hghann/decrypt-otpauth-files


text:
<repo_name>niketanpansare/systemml_tutorial<file_sep>/README.md
# systemml_tutorial
This project contains collections of notebook to teach SystemML:

## General setup to run one of the tutorial Jupyter notebooks on IBM Bluemix:

* Clone the tutorial repository
```
git clone https://github.com/niketanpansare/systemml_tutorial.git
```

* Log on to https://console.ng.bluemix.net/ and create Apache Spark service:

![Setup screenshot](/images/bluemix_screen.jpeg?raw=true "Setup screenshot")

* Go to Apache Spark service dashboard and click on notebook button:

![Setup screenshot](/images/bluemix_spark_screen.jpeg?raw=true "Setup screenshot")

* Create a new notebook:

![Setup screenshot](/images/bluemix_spark_screen2.jpeg?raw=true "Setup screenshot")

* Upload the notebook from this tutorial you want run on bluemix:

![Setup screenshot](/images/bluemix_spark_screen3.jpeg?raw=true "Setup screenshot")

* Hurray, we now have a scala notebook running on bluemix:

![Setup screenshot](/images/bluemix_spark_screen4.jpeg?raw=true "Setup screenshot")

## General setup to run one of the tutorial Zeppelin notebooks on https://datascientistworkbench.com/:

* Clone the tutorial repository
```
git clone https://github.com/niketanpansare/systemml_tutorial.git
```

* Create Zeppelin notebook

![Setup screenshot](/images/datascientistworkbench.jpeg?raw=true "Setup screenshot")

* Upload Zeppelin notebook

![Setup screenshot](/images/datascientistworkbench1.jpeg?raw=true "Setup screenshot")

* Hurray, we now have a scala notebook running on datascientist workbench:

![Setup screenshot](/images/datascientistworkbench2.jpeg?raw=true "Setup screenshot")


text:
<file_sep># Yellow-suede-shoes-lazy-green-wire
Liberal materials and exquisite 100% from nature, quần áo trẻ em bring the baby feel comfortable, everyday busy with small families and especially for all the time caring for her little angel,  áo phông bé trai sometimes mother will feel 24h never be enough time particularly, we are devoted to shopping for baby furniture is always a huge concern, váy bé gái Fashion children bluekids always relentless creativity to produce the sample time most beautiful sites, where the most stylish.


text:
<file_sep># amdgpu-pro drivers mirror

AMD doesn't provides links for previous driver versions.

repo_name: renaudcerrato/amdgpu-pro


text:
<file_sep># The Bravest Map Ever

Searchable map highlighting places that inspire, and encourage bravery and kindness in your community for the Born This Way Foundation.

Based on Derek Eder's [Searchable Map Template](http://derekeder.com/searchable_map_template/).

## Copyright and attribution

Copyright (c) 2014 DataMade and Born This Way Foundation. Released under the MIT License.

Built by [DataMade](http://datamade.us) for [Born This Way Foundation](http://bornthiswayfoundation.org/).

See [LICENSE](https://github.com/derekeder/FusionTable-Map-Template/blob/master/LICENSE) for details

repo_name: datamade/bravest-map-ever


text:
<file_sep>import 'package:e_shop/Authentication/authenication.dart';
import 'package:e_shop/Config/config.dart';
import 'package:e_shop/Address/addAddress.dart';
import 'package:e_shop/Store/Search.dart';
import 'package:e_shop/Store/cart.dart';
import 'package:e_shop/Orders/myOrders.dart';
import 'package:e_shop/Store/storehome.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class MyDrawer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        children: [
          Container(
            padding: EdgeInsets.only(top: 25.0, bottom:10.0),
            child: Column(
              children: [
                Material(
                  borderRadius: BorderRadius.all(Radius.circular(80.0)),
                  elevation: 8.0,
                  child: Container(
                    height: 160.0,
                    width: 160.0,
                    child: CircleAvatar(
                      backgroundImage: NetworkImage(
                        EcommerceApp.sharedPreferences.getString(EcommerceApp.userAvatarUrl),
                      ),
                    ),
                  ),
                ),
                SizedBox(height: 10.0,),
                Text(
                  EcommerceApp.sharedPreferences.getString(EcommerceApp.userEmail),
                  style: TextStyle(color: Colors.black,fontSize:35.0,fontFamily: "Signatra"),
                ),
              ],
            ),
          ),
          SizedBox(height: 12.0,),
          Container(
            padding: EdgeInsets.only(top: 1.0),
            child: Column(
              children: [
                ListTile(
                  leading: Icon(Icons.home, color: Colors.black,),
                  title: Text("Home",style: TextStyle(color: Colors.black),),
                  onTap: (){
                    Route route=MaterialPageRoute(builder: (c)=>StoreHome());
                    Navigator.pushReplacement(context, route);
                  },
                ),
                Divider(height: 10.0,color: Colors.black,thickness: 6.0,),ListTile(
                  leading: Icon(Icons.quick_contacts_dialer, color: Colors.black,),
                  title: Text("Add Phone Number",style: TextStyle(color: Colors.black),),
                  onTap: (){
                    Route route=MaterialPageRoute(builder: (c)=>AddAddress());
                    Navigator.pushReplacement(context, route);
                  },
                ),
                Divider(height: 10.0,color: Colors.black,thickness: 6.0,),ListTile(
                  leading: Icon(Icons.lock, color: Colors.black,),
                  title: Text("Logout",style: TextStyle(color: Colors.black),),
                  onTap: (){
                    EcommerceApp.auth.signOut().then((c){
                      Route route=MaterialPageRoute(builder: (c)=>AuthenticScreen());
                      Navigator.pushReplacement(context, route);
                    });
                  },
                ),
                Divider(height: 10.0,color: Colors.black,thickness: 6.0,),
              ],
            ),
          ),
        ],

      ),
    );
  }
}
<file_sep>import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:e_shop/Widgets/customTextField.dart';
import 'package:e_shop/DialogBox/errorDialog.dart';
import 'package:e_shop/DialogBox/loadingDialog.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import '../Store/storehome.dart';
import 'package:e_shop/Config/config.dart';

class Register extends StatefulWidget {
  @override
  _RegisterState createState() => _RegisterState();
}

class _RegisterState extends State<Register> {
  final TextEditingController _UserNameTextEditingController = TextEditingController();
  final TextEditingController _EmailTextEditingController = TextEditingController();
  final TextEditingController _PasswordTextEditingController = TextEditingController();
  final TextEditingController _ConfirmPasswordTextEditingController = TextEditingController();
  final GlobalKey<FormState>_formkey = GlobalKey<FormState>();
  String userImageUrl = "";
  File _imagefile;

  @override
  Widget build(BuildContext context) {
    double _screenwidth = MediaQuery
        .of(context)
        .size
        .width,
        _screenheight = MediaQuery
            .of(context)
            .size
            .height;
    return
      SingleChildScrollView(
          child: Container(
            child: Column(
                mainAxisSize: MainAxisSize.max,
                children: [
                  SizedBox(height: 10.0,),
                  InkWell(
                    onTap: _SelectAndPickImage,
                    child: CircleAvatar(
                      radius: _screenwidth * 0.15,
                      backgroundColor: Colors.grey,
                      backgroundImage: _imagefile == null ? null : FileImage(
                          _imagefile),
                      child: _imagefile == null ?
                      Icon(Icons.add_photo_alternate, size: _screenwidth * 0.15,
                        color: Colors.black,)
                          : null,
                    ),
                  ),
                  SizedBox(height: 8.0,),
                  Form(
                    key: _formkey,
                    child: Column(
                      children: [
                        CustomTextField(
                          controller: _UserNameTextEditingController,
                          data: Icons.person,
                          hintText: "<NAME>",
                          isObsecure: false,
                        ),
                        CustomTextField(
                          controller: _EmailTextEditingController,
                          data: Icons.email,
                          hintText: "Your Email-Id",
                          isObsecure: false,
                        ),
                        CustomTextField(
                          controller: _PasswordTextEditingController,
                          data: Icons.person,
                          hintText: "Password",
                          isObsecure: true,
                        ),
                        CustomTextField(
                          controller: _ConfirmPasswordTextEditingController,
                          data: Icons.person,
                          hintText: "Confirm Password",
                          isObsecure: true,
                        ),
                      ],
                    ),
                  ),
                  RaisedButton(
                    onPressed: () {UploadAndSaveImage();},
                    color: Colors.blue,
                    child: Text(
                      "Sign Up", style: TextStyle(color: Colors.white),),
                  ),
                  SizedBox(
                    height: 30.0,
                  ),
                  Container(
                    height: 4.0,
                    width: _screenwidth * 0.8,
                    color: Colors.blue,
                  ),
                  SizedBox(
                    height: 15.0,
                  ),
                ]
            ),
          )
      );
  }
  Future<void> _SelectAndPickImage()async{
    _imagefile =await ImagePicker.pickImage(source: ImageSource.gallery);
  }

  Future<void> UploadAndSaveImage()async
  {
    if(_imagefile==null)
    {
      showDialog(
          context: context,
          builder: (c){
            return ErrorAlertDialog(message: "Please Select an Image",);
          }
      );
    }
    else
    {
      _PasswordTextEditingController.text==_ConfirmPasswordTextEditingController.text
          ?_EmailTextEditingController.text.isNotEmpty &&
          _PasswordTextEditingController.text.isNotEmpty &&
          _ConfirmPasswordTextEditingController.text.isNotEmpty &&
          _UserNameTextEditingController.text.isNotEmpty

          ? UploadToStorage()

          :DisplayDialogue("Please Fill all the spaces")
          :DisplayDialogue("Password do not Match");

    }
  }
  DisplayDialogue(String Msg)
  {
    showDialog(
        context: context,
        builder: (c){
          return ErrorAlertDialog(message: Msg,);
        }
    );
  }
  UploadToStorage()async{
    showDialog(
        context:context,
        builder: (c){
          return LoadingAlertDialog(message: "'Regestering, Please wait...'",);
        }
    );

    String ImageFileName=DateTime.now().microsecondsSinceEpoch.toString();
    StorageReference storageReference = FirebaseStorage.instance.ref().child(ImageFileName);
    StorageUploadTask storageUploadTask = storageReference.putFile(_imagefile);
    StorageTaskSnapshot taskSnapshot = await storageUploadTask.onComplete;
    await taskSnapshot.ref.getDownloadURL().then((urlImage){
      userImageUrl = urlImage;

      _regesterUser();
    });

  }
  FirebaseAuth _auth=FirebaseAuth.instance;
  void _regesterUser()async{
    FirebaseUser firebaseUser;
    await _auth.createUserWithEmailAndPassword
      (
      email: _EmailTextEditingController.text.trim(),
      password: _PasswordTextEditingController.text.trim(),
    ).then((auth){
      firebaseUser=auth.user;
    }).catchError((error){
      Navigator.pop(context);
      showDialog(context: context,
          builder:(c){
            return ErrorAlertDialog(message: error.message.toString());
          }
      );
    });
    if(firebaseUser!=null)
    {
      saveUserInfoToFirestore(firebaseUser).then((value){
        Navigator.pop(context);
        Route route=MaterialPageRoute(builder: (c)=>StoreHome());
        Navigator.pushReplacement(context, route);
      });
    }
  }
  Future saveUserInfoToFirestore(FirebaseUser fuser)async{
    Firestore.instance.collection("users").document(fuser.uid).setData({
      "uid":fuser.uid,
      "email":fuser.email,
      "Name": _UserNameTextEditingController.text.trim(),
      "url":userImageUrl,

    });

    await EcommerceApp.sharedPreferences.setString("uid", fuser.uid);
    await EcommerceApp.sharedPreferences.setString(EcommerceApp.userEmail, fuser.email);
    await EcommerceApp.sharedPreferences.setString(EcommerceApp.userName, _UserNameTextEditingController.text);
    await EcommerceApp.sharedPreferences.setString(EcommerceApp.userAvatarUrl, userImageUrl);

  }

// Column(
//   children: [
//     RaisedButton(
//         onPressed: () => RegisterAsUser(),
//         color: Colors.blue,
//         child: Text(
//           "As User", style: TextStyle(fontSize: 30, color: Colors.white),)
//     ),
//     SizedBox(
//
//       height: 15.0,
//     ),
//     RaisedButton(
//         onPressed: () => RegisterAsUser(),
//         color: Colors.blue,
//         child: Text(
//           "As Worker", style: TextStyle(fontSize: 30,color: Colors.white),)
//     ),
//     SizedBox(
//
//       height: 15.0,
//     ),
//   ],
// );
}

<file_sep>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:e_shop/Store/cart.dart';
import 'package:e_shop/Store/product_page.dart';
import 'package:e_shop/Counters/cartitemcounter.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import 'package:e_shop/Config/config.dart';
import '../Widgets/loadingWidget.dart';
import '../Widgets/myDrawer.dart';
import '../Widgets/searchBox.dart';
import '../Models/item.dart';

class sortByPrice extends StatefulWidget {
  @override
  _sortByPriceState createState() => _sortByPriceState();

}

class _sortByPriceState extends State<sortByPrice>
{
  @override
  Widget build(BuildContext context) {

    return Text("helloworld");
  }
}<file_sep>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:e_shop/Store/cart.dart';
import 'package:e_shop/Store/product_page.dart';
import 'package:e_shop/Counters/cartitemcounter.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';
import 'package:e_shop/Config/config.dart';
import '../Widgets/loadingWidget.dart';
import '../Widgets/myDrawer.dart';
import '../Widgets/searchBox.dart';
import '../Models/item.dart';
import 'SortByPrice.dart';
import 'SortByPrice.dart';
import 'SortByRating.dart';

double width;

class StoreHome extends StatefulWidget {
  @override
  _StoreHomeState createState() => _StoreHomeState();
}

class _StoreHomeState extends State<StoreHome> {
  @override
  Widget build(BuildContext context) {
    width = MediaQuery.of(context).size.width;
    return SafeArea(
        child: DefaultTabController(
        length: 2,
        child: Scaffold(
          appBar: AppBar(
          flexibleSpace: Container(
          decoration: new BoxDecoration(
          gradient: new LinearGradient(
        colors: [Colors.blue,Colors.white],
          begin:const FractionalOffset(0.0, 0.0),
          end: const FractionalOffset(1.0, 0.0),
          stops: [0.0,1.0],
          tileMode: TileMode.clamp,
        )
    ),
    ),
    title: Text(
    "TGHS",
    style: TextStyle(fontSize: 55.0,color:Colors.black,fontFamily:"Signatra"),
    ),
    centerTitle: true,

            bottom: TabBar(
              tabs: [
                Tab(
                  child: Text(
                    "Sort By price",
                    style: TextStyle(fontSize: 20.0,color: Colors.black,fontFamily: "Signatra"),
                  ),
                ),
                Tab(
                    child: Text(
                      "Sort By Rating",
                      style: TextStyle(fontSize: 20.0,color: Colors.black,fontFamily: "Signatra"),
                    )
                ),
              ],
              indicatorColor: Colors.black,
              indicatorWeight: 5.0,
            ),
          ),
           drawer: MyDrawer(),
            body:Container(
                decoration: BoxDecoration(
                    gradient: new LinearGradient(
                      colors: [Colors.white,Colors.white],
                      begin:Alignment.topRight,
                      end: Alignment.bottomLeft,
                    )
                ),
                child:TabBarView(
                    children:[
                      sortByPrice(),
                      sortByRating(),
                    ]
                )
            )
        ),
    )
    );
  }
}

Widget sourceInfo(ItemModel model, BuildContext context,
    {Color background, removeCartFunction}) {
  return InkWell();
}

Widget card({Color primaryColor = Colors.redAccent, String imgPath}) {
  return Container();
}

void checkItemInCart(String productID, BuildContext context)
{
}

repo_language: Dart

repo_name: Kshitiz-Rimal/TGHS-UI


text:
<repo_name>kevinsawicki-org/r2<file_sep>/README.md
# r2

foo

bar

baz


text:
<file_sep>package sena.com.co.fallasviales.fragments_mapa;

import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Bundle;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import sena.com.co.fallasviales.R;
import sena.com.co.fallasviales.formulario.FormularioActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class Fragment_ubicacion extends Fragment implements OnMapReadyCallback {

    Button btnenviarformulario;
    String longitud,latitud;

    FormularioActivity formularioActivity = new FormularioActivity();

    public Fragment_ubicacion() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View v = inflater.inflate(R.layout.fragment_ubicacion, container, false);
        SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.idfragment_mapas);
        mapFragment.getMapAsync(this);

        btnenviarformulario = (Button)v.findViewById(R.id.idbtnenviarformulario);

        btnenviarformulario.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                /*
                * Se capturan los datos correspondientes (longitud,latitud)
                * que se envian a la actividad siguiente
                * */
                Intent intent = new Intent(getContext(),FormularioActivity.class);
                Bundle datosmapa = new Bundle();

                datosmapa.putString("longitud",longitud);
                datosmapa.putString("latitud",latitud);

                intent.putExtras(datosmapa);
                startActivity(intent);

            }
        });

        return v;
    }

    @Override
    public void onMapReady(final GoogleMap googleMap) {
        //googleMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("marcador gapp"));

        if (ContextCompat.checkSelfPermission(this.getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this.getContext(),Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            // TODO: Consider calling
            //    public void requestPermissions(@NonNull String[] permissions, int requestCode)
            // here to request the missing permissions, and then overriding
            //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
            //                                          int[] grantResults)
            // to handle the case where the user grants the permission. See the documentation
            // for Activity#requestPermissions for more details.
            return;
        }
        googleMap.setMyLocationEnabled(true);

        googleMap.setOnMyLocationChangeListener(new GoogleMap.OnMyLocationChangeListener() {
            @Override
            public void onMyLocationChange(Location location) {

                googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(),location.getLongitude()),16));
                googleMap.addMarker(new MarkerOptions().title("Fallas Viales").position(new LatLng(location.getLatitude(), location.getLongitude())));
                longitud = " "+location.getLongitude();
                latitud = " "+location.getLatitude();

            }
        });

    }
}
<file_sep>package sena.com.co.fallasviales.commons;

/**
 * Created by <NAME> on 15/02/2016.
 */
public class ConfiguracionGlobal {
    private ConfiguracionGlobal() {
        super();
    }

    public static final String PATTERN = "^[a-zA-Z0-9_-]{2,}(\\.[a-zA-Z0-9_-]{2,})?@[a-zA-Z0-9_-]{2,}\\.[a-zA-Z]{2,4}(\\.[a-zA-Z]{2,4})?$";
    public static final String URL = "https://luminous-fire-2293.firebaseio.com/";
    public static final String URL_BUSCAR = "https://luminous-fire-2293.firebaseio.com/Tipos";
    public static final String USUARIOS = "Usuarios";
    public static final String SALTO_DE_LINEA = "\n";

}
<file_sep>package sena.com.co.fallasviales.Entidades;

/**
 * Created by <NAME> on 15/02/2016.
 */
public class Irregularidad {
    private String cordenadas;
    private String ubicacion;
    private String tipo;
    private String urlFoto;

    public String getUrlFoto() {
        return urlFoto;
    }

    public void setUrlFoto(String urlFoto) {
        this.urlFoto = urlFoto;
    }

    public String getCordenadas() {
        return cordenadas;
    }

    public void setCordenadas(String cordenadas) {
        this.cordenadas = cordenadas;
    }

    public String getUbicacion() {
        return ubicacion;
    }

    public void setUbicacion(String ubicacion) {
        this.ubicacion = ubicacion;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }
}
<file_sep>package sena.com.co.fallasviales.commons;

import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by <NAME> on 15/02/2016.
 */
public class Utilidad {
    static final Logger LOG = Logger.getLogger(Utilidad.class
            .getSimpleName());

    /**
     * Metodo generic para validar objetos nulos     *
     *
     * @param entidad
     * @param <T>
     * @return false en caso verdadero
     */
    public static <T> boolean validaNulos(T entidad) {
        if (null == entidad) {
            return false;
        }
        return true;
    }

    public static boolean cadenaVacia(String cadena) {
        boolean cadenaVacia = true;
        if (cadena == null || cadena.trim().isEmpty()) {
            cadenaVacia = false;
        }
        return cadenaVacia;
    }

    /**
     * Metodo para validar el campo correo
     *
     * @param correo
     * @return
     */
    public static boolean verificarCorreo(String correo) {
        LOG.info("[whilfer]***********Correo **********"+correo);
        final Pattern pat = Pattern
                .compile(ConfiguracionGlobal.PATTERN);
        final Matcher mat = pat.matcher(correo);
        if (mat.find()) {
            return true;
        }
        return false;
    }

    /**
     * valida si es un numero
     *
     * @param cadena
     * @return
     */
    public static boolean isNumeric(String cadena) {
        try {
            Integer.parseInt(cadena);
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
}
<file_sep>package sena.com.co.fallasviales.formulario;

import android.view.View;
import android.widget.Toast;

import com.firebase.client.DataSnapshot;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;
import com.firebase.client.GenericTypeIndicator;
import com.firebase.client.ValueEventListener;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import sena.com.co.fallasviales.Entidades.Usuario;
import sena.com.co.fallasviales.R;
import sena.com.co.fallasviales.commons.ConfiguracionGlobal;
import sena.com.co.fallasviales.commons.Utilidad;

/**
 * Created by <NAME> on 15/02/2016.
 */
public class Auxiliar implements View.OnClickListener {
    static final Logger LOG = Logger.getLogger(Auxiliar.class
            .getSimpleName());
    private final  FormularioActivity datos_activity;
    private Usuario usuario;
    private String tipo;
    private String msjVacio;

    /**
     * constructor
     *
     * @param datos_activity
     */
    public Auxiliar(FormularioActivity datos_activity) {
        this.datos_activity = datos_activity;
    }

    @Override
    public void onClick(View view) {
        guardar();
    }

    /**
     * funcion crear usuario
     *
     * @return
     */
    private void crearUsuario() {
        LOG.info("[whilfer]**********Crear Usuario*************");
        seleccionarTipo();
        Usuario usuario = new Usuario();
        usuario.setCordenadas("Indefinido aun");
        usuario.setUbicacion("Popayán");
        usuario.setTipo(getTipo());
        usuario.setUrlFoto("Por definir");
        usuario.setNombre(datos_activity.getNombre().getText().toString());
        usuario.setApellidos(datos_activity.getApellidos().getText().toString());
        usuario.setCorreoElectronico(datos_activity.getCorreoElectronico().getText().toString());
        setUsuario(usuario);
    }

    /**
     * valida campos del formulario no esten vacios
     *
     * @return
     */
    private boolean validacionVacio() {
        boolean c1 = false;
        boolean c2 = false;
        boolean c3 = false;
        final StringBuilder msjVacios = new StringBuilder();
        msjVacios.append(datos_activity.getApplicationContext().getText(R.string.msjCampos));
        if (Utilidad.cadenaVacia(datos_activity.getNombre().getText().toString())) {
            c1 = true;
        } else {
            msjVacios.append(ConfiguracionGlobal.SALTO_DE_LINEA);
            msjVacios.append(datos_activity.getApplicationContext().getText(R.string.nombres));
        }
        if (Utilidad.cadenaVacia(datos_activity.getApellidos().getText().toString())) {
            c2 = true;
        } else {
            msjVacios.append(ConfiguracionGlobal.SALTO_DE_LINEA);
            msjVacios.append(datos_activity.getApplicationContext().getText(R.string.apellidos));
        }
        if (Utilidad.cadenaVacia(datos_activity.getCorreoElectronico().getText().toString())) {
            c3 = true;
        } else {
            msjVacios.append(ConfiguracionGlobal.SALTO_DE_LINEA);
            msjVacios.append(datos_activity.getApplicationContext().getText(R.string.email));
        }

        if (c1 && c2 && c3) {
            return true;
        } else {
            msjVacio = msjVacios.toString();
        }
        return false;
    }
    /**
     * Metodo Guardar
     */
    private void guardar() {
        LOG.info("[whilfer]**********Guardar*************");
        //inicilizo variable
        setUsuario(new Usuario());
        if (!validacionVacio()) {
            lanzaMensaje(getMsjVacio());
        } else if (!Utilidad.verificarCorreo(datos_activity.getCorreoElectronico().getText().toString())) {
            lanzaMensaje(String.valueOf(datos_activity.getApplicationContext().getText(R.string.msjErrorEmail)));
        } else {
            crearUsuario();
            datos_activity.getFirebase().child(ConfiguracionGlobal.USUARIOS).child(getUsuario().getNombre()).setValue(getUsuario());
            lanzaMensaje(String.valueOf(datos_activity.getApplicationContext().getText(R.string.msjResExitoso)));
            LOG.info("[whilfer]********** Usuario guardado*************");
            limpiar();
        }
    }

    /**
     * limpiar
     */
    private void limpiar() {
        setUsuario(new Usuario());
        datos_activity.getNombre().setText("");
        datos_activity.getNombre().invalidate();
        datos_activity.getApellidos().setText("");
        datos_activity.getApellidos().invalidate();
        datos_activity.getCorreoElectronico().setText("");
        datos_activity.getCorreoElectronico().invalidate();
    }

    /**
     * selecciona tipo daño
     */
    private void seleccionarTipo() {

        if(datos_activity.getTiposDanos()!=null) {
            setTipo(datos_activity.getTipos().getSelectedItem().toString());
            LOG.info("[whilfer]**********dato seleccionado*************" + getTipo());
        }else{
            lanzaMensaje(String.valueOf(datos_activity.getApplicationContext().getText(R.string.msjResNoExitoso)));

        }
    }

    /**
     * cargar tipos de daños
     */
    public void cargarTipos() {
        LOG.info("[whilfer]**********Cargando tipos*************");
        final ValueEventListener valueEventListener = datos_activity.getFirebaseTipos().addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                LOG.info("[whilfer]********* valores dataSnapshot **************" + dataSnapshot);
                final GenericTypeIndicator<List<String>> t = new GenericTypeIndicator<List<String>>() {
                };
                final List<String> list = dataSnapshot.getValue(t);
                LOG.info("[whilfer]********* tamaño lista **************" + list.size());
                if (!list.isEmpty()) {
                    for (String items : list) {
                        datos_activity.getTiposDanos().add(items);
                        datos_activity.getTipos().setAdapter(datos_activity.getTiposDanos());
                    }
                }

            }

            @Override
            public void onCancelled(FirebaseError firebaseError) {
                // Toast.makeText(activity,getResources().getText(R.string.Error),Toast.LENGTH_SHORT).show();
            }
        });

    }

    /**
     * Metodo para lanzar mensajes
     *
     * @param mensaje
     */
    private final void lanzaMensaje(String mensaje) {
        final Toast toast =
                Toast.makeText(datos_activity.getApplicationContext(),
                        mensaje, Toast.LENGTH_SHORT);
        toast.show();
    }

    //gettrrs sertters
    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public String getMsjVacio() {
        return msjVacio;
    }

    public void setMsjVacio(String msjVacio) {
        this.msjVacio = msjVacio;
    }
}
<file_sep>package sena.com.co.fallasviales.Entidades;

/**
 * Created by <NAME> on 15/02/2016.
 */
public class Usuario extends Irregularidad{
    private String nombre;
    private String apellidos;
    private String correoElectronico;

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApellidos() {
        return apellidos;
    }

    public void setApellidos(String apellidos) {
        this.apellidos = apellidos;
    }

    public String getCorreoElectronico() {
        return correoElectronico;
    }

    public void setCorreoElectronico(String correoElectronico) {
        this.correoElectronico = correoElectronico;
    }
}

repo_language: Java

repo_name: ProyectoGapp/ProyectoFallasViales


text:
<file_sep>package com.zhy.base;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.zhy.RecyclerEasyAdapter;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * yhz on 2020/8/21
 * BaseSimpleEasyAdapter 单布局使用(getItemViewType()只有一种的时候使用)
 */
public abstract class BaseSimpleEasyAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerEasyAdapter {

    protected ArrayList<T> mList = new ArrayList<T>();

    @Override
    public void whenBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        bindViewHolder((VH) holder, position, mList.get(position));
    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(getLayoutId(), null);
        return getViewHolder(view);
    }

    protected abstract void bindViewHolder(VH holder, int position, T model);

    /**
     * 生成泛型ViewHolder
     *
     * @param view
     * @return
     */
    protected VH getViewHolder(View view) {
        Type type = getClass().getGenericSuperclass();
        ParameterizedType pt = (ParameterizedType) type;
        Class modelClass = (Class) pt.getActualTypeArguments()[1];
        try {
            Constructor con = modelClass.getConstructor(View.class);
            return (VH) con.newInstance(view);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public int getItemCount() {
        return mList.size();
    }

    /**
     * 设置数据
     *
     * @param list
     */
    public void setData(List<T> list) {
        mList.clear();
        mList.addAll(list);
        notifyDataSetChanged();
    }

    public ArrayList<T> getList() {
        return mList;
    }

    protected abstract int getLayoutId();
}
<file_sep>include ':app'
include ':lib_com'
rootProject.name = "ZhyCom"<file_sep># 公用类库

使用方法

implementation 'com.github.yumeyang:ZhyCom:1.1.1'

languages: Java Markdown Gradle

repo_name: yumeyang/ZhyCom


text:
<repo_name>wtedongmo/SpringBoot-OTP-Email-Thymeleaf<file_sep>/Readme.md

# Spring Boot Web app with OTP Email and Thymeleaf
Spring-boot web application with Google guava library to handle OTP concepts.

One Time Password (OTP) is a password to validate to do some secure transaction. Mostly, this cocepts used in banking system and other secure website.

The most important advantage that is addressed by OTPs is that, in contrast to static passwords, they are not vulnerable to replay attacks. This means that a potential intruder who manages to record an OTP that was already used to log into a service or to conduct a transaction will not be able to abuse it, since it will no longer be valid. A second major advantage is that a user who uses the same (or similar) password for multiple systems, is not made vulnerable on all of them, if the password for one of these is gained by an attacker.

OTP password are generated mathematical algorithm, I have used Random number concpets in this example.

Method of Delivering OTP in webapplication.

1. Mobile Device (SMS)
2. Email

I have shown the steps to configure OTP in email.

Used Google Guava to cache the OTP number to validate and it get expired  in 10 mins. It is better to set this params in properties files


text:
<file_sep><!DOCTYPE html>
<html lang="ru">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>php-spa</title>

        <? foreach ($this->_meta as $property => $content): ?>
            <meta name="<?= $property; ?>"
                  property="<?= $property; ?>"
                  content="<?= $content; ?>" />
        <? endforeach; ?>
    </head>
    <body>
        php-spa was successfully installed
    </body>
</html>
<file_sep><?php
/**
 * @author ismd
 */

class ErrorController extends PsController {

    public function indexAction() {
        http_response_code(404);
        $this->view->render('error');
    }
}
<file_sep><?php
/**
 * Главная страница
 * @author ismd
 */

class IndexController extends PsController {

    public function indexAction() {
    }
}
<file_sep>[main]
environment = production
error_log =

[database]
host =
username =
password =
dbname =

[log]
filename = /tmp/php-spa.log

[timezone]
server = Asia/Novosibirsk

[url_prefixes]
partial = partial
action = api

languages: HTML+PHP INI PHP

repo_language: HTML+PHP

repo_name: ismd/php-spa