text:
<file_sep># yangjiangtao1
haihao


text:
<file_sep>module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        uglify: {
            options: {
                banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
            },
            src: {
                expand: true,
                cwd: "src/js",
                src: ["**/*.js"],
                dest: "public/js",
                ext: ".min.js"
            }
        },

        less: {
            options: {
                paths: ["src/less"]
            },
            src: {
                expand: true,
                cwd: "src/less",
                src: ["**/*.less"],
                dest: "src/css",
                ext: ".css"
            }
        },

        cssmin: {
            options: {
                banner: '/*\n <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
            },
            src: {
                expand: true,
                cwd: "src/css",
                src: ["**/*.css"],
                dest: "public/css",
                ext: ".min.css"
            }
        },

        watch: {
            stylesheets: {
                files: ['src/**/*.css', 'src/**/*.less'],
                tasks: ['less', 'cssmin']
            },
            scripts: {
                files: 'src/**/*.js',
                tasks: ['uglify']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default', ['less', 'uglify', 'cssmin']);

};
<file_sep>
{{> header title='Full Website - No Man Walks Alone' description='Full Website for No Man Walks Alone'}}

    {{>header-main}}

    {{>portfolio-body title='Full Website' description='Created the Full Website for No Man Walks Alone.' client='No Man Walks Alone' lang='HTML, CSS' github='https://github.com/jomizrahi92/No-Man-Walks-Alone' site='http://www.nomanwalksalone.com' img='noman'}}

    {{>footer}}

<file_sep># Website
My website JosephMizrahi.com
<file_sep><?php

session_start();
require_once("twitteroauth.php"); //Path to twitteroauth library

$twitteruser = $_GET['username'];
$notweets = $_GET['limit'];
$consumerkey = "<KEY>";
$consumersecret = "<KEY>";
$accesstoken = "<KEY>";
$accesstokensecret = "<KEY>";

function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
    $connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
    return $connection;
}

$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);

// if username isn't array check if user separated usernames with comma
if (!is_array($twitteruser))
    $twitteruser = explode(',', trim($twitteruser));

if (count($twitteruser) > 1) {

    $all_tweets = array();
    $remainder = $notweets % count($twitteruser);
    $tweets_per_user = floor($notweets / count($twitteruser));

    // split tweets per user so it doesn't exceed limit
    foreach ($twitteruser as $user) {
        if ($remainder > 0) {
            $notweets = $tweets_per_user + $remainder;
        } else {
            $notweets = $tweets_per_user;
        }

        // get tweets
        $tweets[] = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" . $user . "&count=" . $notweets);
    }

    // merge into one array
    $all_tweets = $tweets[0];
    for ($i = 1; $i < count($tweets); $i++) {
        $all_tweets = array_merge($all_tweets, $tweets[$i]);
    }
} else {
    $all_tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" . $twitteruser[0] . "&count=" . $notweets);
}

header('content-type: application/json');
echo json_encode($all_tweets);
exit();
?><file_sep>
{{> header title='Full Website - JS Hatzalah Carnival' description='Full Website for JS Hatzalah Carnival'}}

    {{>header-main}}

    {{>portfolio-body title='Full Website' description='Created the Full Website for JS Hatzalah Carnival.' client='JS Hatzalah Carnival' lang='HTML, CSS, JavaScript, jQuery, PHP' github='https://github.com/jomizrahi92/Hatzalah-Carnival' site='http://hatzalahcarnival.com' img='jshatzalahcarnival'}}

    {{>footer}}

<file_sep>
{{> header title='Full Website - Layer8' description='Full Website for Layer8'}}

    {{>header-main}}

    {{>portfolio-body title='Full Website' description='Created the Full Website for Layer8.' client='Layer8' lang='HTML, CSS, JavaScript, jQuery' github='https://github.com/jomizrahi92/Layer8' site='n' img='layer8'}}

    {{>footer}}

<file_sep>
{{> header title='Full Website - Tricoastal' description='Full Website for Tricoastal'}}

    {{>header-main}}

    {{>portfolio-body title='Full Website' description='Created the Full Website for Tricoastal.' client='Tricoastal' lang='HTML, CSS, JavaScript, jQuery' github='https://github.com/jomizrahi92/Tricoastal' site='http://www.tricoastaldesign.com' img='tricoastal'}}

    {{>footer}}

<file_sep>
{{>header title='<NAME> - Web Developer | Develops Websites' description='<NAME> is a Software Engineer at MLB. He loves Web Developement, and has developed numberous websites. He is also an iOS and OS X Enthusiast.'}}

    {{>header-home}}

    {{>header-main}}

    {{{body}}}

    {{>preloader}}

    {{>footer}}

<file_sep>/*
 * TweetScroll jQuery Plugin
 * Author: Pixel Industry
 * Author URL : http://pixel-industry.com
 * Version: 1.2.6
 *
 * jQuery plugin to load latest Twitter tweets.
 *
 */

(function($) {
    //define the tweetable plugin
    $.fn.tweetscroll = function(options) {
        //specify the plugins defauls
        var defaults = {
            limit: 5, //number of tweets to fetch
            visible_tweets: 2, //number of tweets to be visible
            speed: 600, // scroll animation speed
            delay: 3000, // delay between animations
            username: 'JosephMizrahi', //@username tweets to display. can be multiple usernames e.g. [philipbeel, vmrkela]
            time: false, //display date
            replies: false, //filter out @replys
            date_format: 'style1',
            animation: 'slide_up',
            url_new_window: false,
            request_url: 'twitter/tweets.php',
            logo: false,
            profile_image: false
        };
        //overwrite the defaults
        var tweetscrollOptions = $.extend({}, defaults, options);

        // verify if speed value is number
        if (isNaN(tweetscrollOptions.speed)) {
            tweetscrollOptions.speed = 600;
        }

        // verify if speed value is number
        if (isNaN(tweetscrollOptions.delay)) {
            tweetscrollOptions.delay = 3000;
        }

        // Wordpress widget change
        tweetscrollOptions['instance_id'] = $(this).attr('data-instance-id');
        if (!tweetscrollOptions['instance_id'])
            tweetscrollOptions['instance_id'] = "";
        tweetscrollOptions['action'] = 'pi_tweetscroll_ajax';

        //loop through each instance
        return this.each(function(options) {
            //assign our initial vars
            var act = $(this);
            var $allTweets;

            // Wordpress/jQuery widget difference
            if (typeof (PiTweetScroll) == 'undefined') {
                var requestURL = tweetscrollOptions.request_url;
            } else {
                var requestURL = PiTweetScroll.ajaxrequests;
            }

            if (tweetscrollOptions.animation == false) {
                tweetscrollOptions.limit = tweetscrollOptions.visible_tweets;
            }

            //do a JSON request to twitter API
            $.getJSON(requestURL, tweetscrollOptions, function(data) {
                $allTweets = createHtml(data, tweetscrollOptions);
                $($allTweets).appendTo(act);
                setInitialListHeight($allTweets);
                setTimeout(function() {
                    animateTweets($allTweets);
                }, tweetscrollOptions.delay);

            });

            function animateTweets($allTweets) {
                var scrollSpeed = tweetscrollOptions.speed;

                switch (tweetscrollOptions.animation) {
                    case 'slide_down':
                        var itemHeight = $allTweets.find('li').outerHeight();
                        var containerSize = 0;
                        var visibleItemsMax = tweetscrollOptions.visible_tweets;
                        for (var i = 1; i < visibleItemsMax; i++) {
                            var selector = $allTweets.find("li:nth-child(" + i + ")");
                            containerSize += $(selector).outerHeight();
                        }
                        var lastItemHeight = parseInt($allTweets.find("li:last").outerHeight());

                        containerSize += lastItemHeight;

                        $allTweets.parent().css({
                            'height': containerSize
                        });

                        /* animate the carousel */
                        $allTweets.animate(
                                {
                                    'bottom': -lastItemHeight
                                }, scrollSpeed, 'linear', function() {
                            /* put the last item before the first item */
                            $allTweets.find('li:first').before($allTweets.find('li:last'));

                            /* reset top position */
                            $allTweets.css({
                                'bottom': 0
                            });

                            window.setTimeout(function() {
                                animateTweets($allTweets);
                            }, tweetscrollOptions.delay);
                        });
                        break;
                    case 'slide_up':
                        var itemHeight = $allTweets.find('li').outerHeight();
                        var containerSize = 0;
                        var visibleItemsMax = tweetscrollOptions.visible_tweets + 2;
                        for (var i = 2; i < visibleItemsMax; i++) {
                            var selector = $allTweets.find("li:nth-child(" + i + ")");
                            containerSize += $(selector).outerHeight();
                        }

                        $allTweets.parent().css({
                            'height': containerSize
                        });
                        /* animate the carousel */
                        $allTweets.animate(
                                {
                                    'top': -itemHeight
                                }, scrollSpeed, 'linear', function() {
                            /* put the last item before the first item */
                            $allTweets.find('li:last').after($allTweets.find('li:first'));

                            /* reset top position */
                            $allTweets.css({
                                'top': 0
                            });

                            window.setTimeout(function() {
                                animateTweets($allTweets);
                            }, tweetscrollOptions.delay);
                        });

                        break;
                    case 'fade':
                        var itemHeight = $allTweets.outerHeight();
                        var containerSize = 0;

                        var moveFactor = parseInt($allTweets.css('top')) + itemHeight;

                        /* animate the carousel */
                        $allTweets.animate(
                                {
                                    'opacity': 0
                                }, scrollSpeed, 'linear', function() {
                            /* put the last item before the first item */
                            var selectorString = $allTweets.find('li:lt(' + tweetscrollOptions.visible_tweets + ')');
                            $allTweets.find('li:last').after($(selectorString));
                            for (var i = 1; i <= tweetscrollOptions.visible_tweets; i++) {
                                var selector = $allTweets.find("li:nth-child(" + i + ")");
                                containerSize += $(selector).outerHeight();
                            }

                            $allTweets.parent().css({
                                'height': containerSize
                            });

                            $allTweets.animate({
                                opacity: 1
                            });

                            window.setTimeout(function() {
                                animateTweets($allTweets);
                            }, tweetscrollOptions.delay);

                        });
                        break;
                }
            }

            function setInitialListHeight($allTweets) {
                var containerSize = 0;

                if (tweetscrollOptions.animation == 'slide_down') {
                    var visibleItemsMax = tweetscrollOptions.visible_tweets + 1;
                    for (var i = 1; i < visibleItemsMax; i++) {
                        var selector = $allTweets.find("li:nth-child(" + i + ")");
                        containerSize += $(selector).outerHeight();
                    }
                    $allTweets.parent().css({
                        'height': containerSize
                    });
                    $allTweets.css({
                        'bottom': 0
                    });

                } else if (tweetscrollOptions.animation == 'slide_up') {
                    var visibleItemsMax = tweetscrollOptions.visible_tweets + 1;
                    for (var i = 1; i < visibleItemsMax; i++) {
                        var selector = $allTweets.find("li:nth-child(" + i + ")");
                        containerSize += $(selector).outerHeight();
                    }
                    $allTweets.parent().css({
                        'height': containerSize
                    });
                } else if (tweetscrollOptions.animation == 'fade') {
                    var visibleItemsMax = tweetscrollOptions.visible_tweets + 1;
                    for (var i = 1; i < visibleItemsMax; i++) {
                        var selector = $allTweets.find("li:nth-child(" + i + ")");
                        containerSize += $(selector).outerHeight();
                    }
                    $allTweets.parent().css({
                        'height': containerSize
                    });

                }
            }

        });

        /**
        * relative time calculator FROM TWITTER
        * @param {string} twitter date string returned from Twitter API
        * @return {string} relative time like "2 minutes ago"
        */
        function timeAgo(dateString) {
            var rightNow = new Date();
            var then = new Date(dateString);

            if ($.browser.msie) {
                // IE can't parse these crazy Ruby dates
                then = Date.parse(dateString.replace(/( \+)/, ' UTC$1'));
            }
            var diff = rightNow - then;
            var second = 1000,
            minute = second * 60,
            hour = minute * 60,
            day = hour * 24,
            week = day * 7;
            if (isNaN(diff) || diff < 0) {
                return ""; // return blank string if unknown
            }
            if (diff < second * 2) {
                // within 2 seconds
                return "right now";
            }
            if (diff < minute) {
                return Math.floor(diff / second) + " seconds ago";
            }
            if (diff < minute * 2) {
                return "about 1 minute ago";
            }
            if (diff < hour) {
                return Math.floor(diff / minute) + " minutes ago";
            }
            if (diff < hour * 2) {
                return "about 1 hour ago";
            }
            if (diff < day) {
                return Math.floor(diff / hour) + " hours ago";
            }
            if (diff > day && diff < day * 2) {
                return "yesterday";
            }
            if (diff < day * 365) {
                return Math.floor(diff / day) + " days ago";
            }
            else {
                return "over a year ago";
            }
        }

        function createHtml(data, tweetscrollOptions) {
            var $tweetList;
            var tweetMonth = '';
            var shortMonths = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
            var allMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "Septemper", "October", "November", "December"];

            $.each(data, function(i, item) {
                var profileImage = item.user.profile_image_url;
                //check for the first loop
                if (i == 0) {
                    $tweetList = $('
');
                    if (tweetscrollOptions.logo)
                        $tweetList.addClass('twitter-logo');
                }

                //handle @reply filtering if required
                if (tweetscrollOptions.replies === false) {
                    if (item.in_reply_to_status_id === null) {
                        if (tweetscrollOptions.profile_image) {
                            $tweetList.append('

' + item.text.replace(/#(.*?)(\s|$)/g, '#$1 ').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '$& ').replace(/@(.*?)(\s|\(|\)|$)/g, '@$1 $2') + '

');

                        } else {
                            $tweetList.append('

' + item.text.replace(/#(.*?)(\s|$)/g, '#$1 ').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '$& ').replace(/@(.*?)(\s|\(|\)|$)/g, '@$1 $2') + '

');
                        }
                    }
                } else {
                    if (tweetscrollOptions.profile_image) {
                        $tweetList.append('

' + item.text.replace(/#(.*?)(\s|$)/g, '#$1 ').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '$& ').replace(/@(.*?)(\s|\(|\)|$)/g, '@$1 $2') + '

');
                    } else {
                        $tweetList.append('

' + item.text.replace(/#(.*?)(\s|$)/g, '#$1 ').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '$& ').replace(/@(.*?)(\s|\(|\)|$)/g, '@$1 $2') + '

');
                    }
                }
                //display the time of tweet if required
                if (tweetscrollOptions.time == true) {
                    var monthIndex = jQuery.inArray(item.created_at.substr(4, 3), shortMonths);

                    if (tweetscrollOptions.date_format == 'style1') {
                        tweetMonth = monthIndex + 1;
                        if (tweetMonth < 10) {
                            tweetMonth = '0' + tweetMonth;
                        }
                        $tweetList.find('.tweet_link_' + i).append(' ' + item.created_at.substr(8, 2) + '/' + tweetMonth + '/' + item.created_at.substr(26, 4) + ' ' + item.created_at.substr(11, 8) + '');
                    } else if (tweetscrollOptions.date_format == 'style2') {
                        tweetMonth = allMonths[monthIndex];
                        $tweetList.find('.tweet_link_' + i).append(' ' + tweetMonth + ' ' + item.created_at.substr(8, 2) + ', ' + item.created_at.substr(26, 4) + ' ' + item.created_at.substr(11, 8) + '');
                    } else {
                      relativeTime = timeAgo(item.created_at);
                      $tweetList.find('.tweet_link_' + i).append(' ' + relativeTime + '');
                    }

                }

            });

            if (tweetscrollOptions.animation == 'slide_down') {
                $tweetList.find('li').each(function() {
                    $(this).prependTo($(this).parent());
                });
            }

            //check how to open link, same page or in new window
            if (tweetscrollOptions.url_new_window == true) {
                $tweetList.find('a').each(function() {
                    $(this).attr({
                        target: '_BLANK'
                    });
                });
            }

            return $tweetList;
        }
    }
})(jQuery);

branch_name: refs/heads/master

languages: Markdown HTML JavaScript PHP

repo_language: Markdown


text: <file_sep>### Hi there 👋 How are You?

branch_name: refs/heads/main

repo_name: makeros/makeros


text:
<repo_name>Jakekick99/Project<file_sep>/Home/home.html
<!DOCTYPE HTML>

		<link rel="stylesheet" href="home.css">
		<link rel="shortcut icon" href="logo_APS.png" />
		<title>Home</title>

		ARMY PUBLIC SCHOOL ELECTION

				HOME
				ADD CANDIDATES
				CHECK CONNECTION
				START ELECTION
				SUPPORT

		Dear all,

		Welcome to, what is the final and finished version of my continous development program - The Election Software for Army Public School, Chennai. Five years in the making, from a simple software with a basic interface has finally become a website that can work across all screens and devices.

		As an avid programmer and hardcore computer nerd, this will always be my first programming "contract". I still remember asking my Principal about conducting the elction electronically through the computer. The pretext of saving paper was a convincing cover story for my enthusiasm to test my programming skills. From then on, it was a project that I constantly focused on; learning new skills and techniques and infusing them into the project to make it better. My constant experimentation and dabbling in the latest of computer science would have all been for naught without this oppurtunity to express my creativity ( or should I say crazy ideas ).

		To all my teachers who supported me in this journey of the student council, I cannot express my gratitude and thanks for all the supporr and smiles I recieved along the way. As my technical guru, <NAME> showed me the technical road of 0s and 1s while <NAME> was the constant challenger, making the election program more advanced and better with constant upgrades.Finally, my tutor through 11th and 12th and more notably , the Sir who allowed me to tutor the rest of my class was <NAME>. His guidance and oppurtunity to teach and to motivate me with his kind words were a constant support, epecially through my board exams. Finally, I remember my election days through the years, where all election official teachers joined hands to make the voting proceed smoothly and helped the students exercise their right to vote.

		While my fellow friends and notably juniors did complain that electronic voting made things go much faster and lost time to bunk classes, I'm glad that this never dented their enthusiasm to participate in the competition. Not only did they constantly support and update my progress, they ensured that my procrastination didn't leave the project undone. To all my friends; seniors, classmates and juniors alike, I express my teary eyed thanks. My memories are filled with our days together and no words can describe the fun we had.

		As a former Head Boy myself, I still stand by my words; I felt no pressure wearing the badge. If you believe in the trust placed in you and treat that trust and responsibility with fairness and hard work, the badge become an honour rather than a chore. My only regret rather was never being able to recite the pledge in Hindi; something I'm sure will leave an embarrasing smile on my face.

		To all those who participate for the honour and glory in the race to lead the school to dazzling new heights yet to be reached, I wish them best of luck. May the best win !!

		Finally, to my beloved Principal, Mrs.<NAME>. Ma'am, hadn't you said yes the day I asked, this whole journey wouldn't have taken any step forward.

		To ARMY PUBLIC SCHOOL
Chennai

		<NAME>

		<img id="f1"src="Footer.jpeg" alt="<NAME>" /><img id="f2" src="election.jpg" alt="<NAME>" />

		This website was created with a 7 year old computer and all the knowledge required to make this happen was learnt from the internet through various free to learn courses and encyclopedia. I hope this is proof enough that you don't need expensive Apple computers or special training to build your code. And in the spirit of Coding Adventure, I challenge you to go find your own ways to learn the programming paradigm ( Oh and all copy rights of this website are owned by me, <NAME>, developer and maintenance )&copy &#8482 &reg

<file_sep>/README.md
# Project
Everything for now

languages: Markdown HTML


text:
<repo_name>eniantafa/book-e-commerce-project<file_sep>/src/components/Slider.js
import React, { Component }  from 'react';
import AwesomeSlider from 'react-awesome-slider';
import 'react-awesome-slider/dist/styles.css';

export default class Slider extends Component {

    render() {
      return (
        <AwesomeSlider animation="cubeAnimation" autoplay="true" >

      </AwesomeSlider>
      );
    }
  }<file_sep>/src/components/Footer.js
import React, { Component }  from 'react';
import StickyFooter from 'react-sticky-footer';

export default class Footer extends Component {

    render() {
      return (
        <StickyFooter
        bottomThreshold={50}
        normalStyles={{
        backgroundColor: "#2a2a72",
        padding: "2rem"
        }}
        stickyStyles={{
        backgroundColor: "rgba(255,255,255,.8)",
        padding: "2rem"
        }}
    >
        ©2020 All Right Reserved - <NAME>, Software Engineer
    </StickyFooter>
      );
    }
  }

repo_language: JavaScript

repo_name: eniantafa/book-e-commerce-project


text:
<file_sep>from kivymd.app import MDApp
from kivymd.uix.screen import Screen
from kivymd.uix.boxlayout import BoxLayout
from kivymd.uix.button import MDFillRoundFlatButton
from kivy.lang import Builder
from kivy.core.window import Window
from requests import get
from os.path import basename
import json

# Window.size = (300, 500) # Used to debug on PC

screen_helper = """
Screen:
    orientation: "vertical"

    MDToolbar:
        md_bg_color: 1, .8, .5, 1
        id: topbar
        title: "Level finder"
        pos_hint: {"top":1.0}

    MDBottomNavigation:
        MDBottomNavigationItem:
            name: "lvl_find"
            text: "Level finder"
            on_tab_release: current_finder = "lvl"

            MDTextField:
                id: userinput_lvl
                hint_text: "Enter Id of level"
                pos_hint: {"top":.85, "center_x":.5}
                size_hint_x: .8
                line_color_focus: 1, .8, .5, 1

            MDFillRoundFlatButton:
                text: "Search"
                pos_hint: {"center_x":.5, "center_y":.7}
                on_release: app.request_api("lvl")

            MDFillRoundFlatButton:
                text: "Download song"
                pos_hint: {"center_x":.5, "center_y":.6}
                on_release: app.request_api("sng_download_lvl")

            MDLabel:
                id: info_lvl
                text: " "
                halign: "center"
                pos_hint: {"center_x":.5, "center_y":.4}

        MDBottomNavigationItem:
            name: "plr_find"
            text: "Player fider"

            MDTextField:
                id: userinput_plr
                hint_text: "Enter Id or Username of player"
                pos_hint: {"top":.85, "center_x":.5}
                size_hint_x: .8
                line_color_focus: 1, .8, .5, 1

            MDFillRoundFlatButton:
                text: "Search"
                pos_hint: {"center_x":.5, "center_y":.7}
                on_release: app.request_api("plr")

            MDLabel:
                id: info_plr
                text: " "
                halign: "center"
                pos_hint: {"center_x":.5, "center_y":.4}

        MDBottomNavigationItem:
            name: "songs"
            text: "Song check"
            id: sng_tab

            MDTextField:
                id: userinput_sng
                hint_text: "Enter song ID"
                pos_hint: {"top":.85, "center_x":.5}
                size_hint_x: .8
                line_color_focus: 1, .8, .5, 1

            MDFillRoundFlatButton:
                text: "Check"
                pos_hint: {"center_x":.5, "center_y":.7}
                on_release: app.request_api("sng_check")

            MDFillRoundFlatButton:
                text: "Download"
                pos_hint: {"center_x":.5, "center_y":.6}
                on_release: app.request_api("sng_download")

            MDLabel:
                text: " "
                id: info_sng
                halign: "center"
                pos_hint: {"center_x":.5, "center_y":.4}
"""

# 70521879 | test level ID

# 1067091 1060826 | test song IDs

class MainApp(MDApp):

    class ContentNavigationDrawer(BoxLayout):
        pass

    def build(self):
        screen = Builder.load_string(screen_helper)

        return screen

    def request_api(self, request):
        info_label = ""
        if request == "lvl":
            try:
                info = get("https://www.gdbrowser.com/api/level/" + self.root.ids.userinput_lvl.text).text
                info = json.loads(info)

                info_label += "Name: " + info["name"]
                info_label += "\nSong: " + info["songName"] + " by " + info["songAuthor"]
                info_label += "\nSong ID: " + str(info["songID"])
                info_label += "\nAuthor: " + info["author"]
                info_label += "\nDifficulty: " + info["difficulty"]
                if info["stars"] > 0:
                    info_label += " (" + str(info["stars"]) + " stars)"
                else:
                    info_label += " ( No stars )"

                    if info["featured"]:
                        if info["epic"]:
                            info_label += "\nEpic rate"
                        else:
                            info_label += "\nFeatured rate"
            except:
                info_label = "An error has occured"

            self.root.ids.info_lvl.text = info_label

        elif request == "plr":
            try:
                info = get("https://www.gdbrowser.com/api/profile/" + self.root.ids.userinput_plr.text).text
                info = json.loads(info)

                info_label += "Name: " + info["username"]
                info_label += "\nGlobal rank: " + str(info["rank"])
                info_label += "\nDemons: " + str(info["demons"])
                info_label += "\nAccount / Player IDs: " + str(info["playerID"]) + " / " + str(info["accountID"])
                info_label += "\nStars: " + str(info["stars"])
                info_label += "\nDiamonds: " + str(info["diamonds"])
                info_label += "\nOfficial coins: " + str(info["coins"])
                info_label += "\nUser coins: " + str(info["userCoins"])
                info_label += "\nCreator points: " + str(info["cp"])
                info_label += "\nModeration level: "
                if info["moderator"] == 0:
                    info_label += "Player"
                elif info["moderator"] == 1:
                    info_label += "Moderator"
                elif info["moderator"] == 2:
                    info_label += "Older moderator"

            except:
                info_label = "An error has occured"

            self.root.ids.info_plr.text = info_label
        elif request == "sng_check":
            try:
                info = get("https://www.gdbrowser.com/api/song/" + self.root.ids.userinput_sng.text).text
                if info:
                    info_label = "Song is allowed"
                else:
                    info_label = "Song is disallowed"
            except:
                info_label = "An error has occured"

            self.root.ids.info_sng.text = info_label

        elif request == "sng_download":
            try:
                song = get("https://www.newgrounds.com/audio/download/" + str(self.root.ids.userinput_sng.text))

                songname = song.headers["content-disposition"].replace("attachment; filename=", "")
                songname = songname[1:-1]

                with open("/storage/emulated/0/Music/" + songname, "wb") as file:
                   file.write(song.content)

                self.root.ids.info_sng.text = "Music saved! (check your Music folder)"

            except:
                self.root.ids.info_sng.text = "An error has occured"

        elif request == "sng_download_lvl":
            try:
                levelinfo = get("https://www.gdbrowser.com/api/level/" + self.root.ids.userinput_lvl.text).text
                levelinfo = json.loads(levelinfo)

                song = get("https://www.newgrounds.com/audio/download/" + str(levelinfo["songID"]))

                songname = song.headers["content-disposition"].replace("attachment; filename=", "")
                songname = songname[1:-1]

                with open("/storage/emulated/0/Music/" + songname, "wb") as file:
                    file.write(song.content)

                    self.root.ids.info_lvl.text = "Music saved! (check your Music folder)"

            except:
                self.root.ids.info_lvl.text = "An error has occured"

MainApp().run()
<file_sep># kivyGDBrowser
Simple automation tool for GD players

Made with KivyMD

# Main features:
**Downloading song by level ID or song ID**

**Checking informations about levels and players**

**Checking is song available to use in GD**

# Other fetures:
**Wait for it**

# Project can be built with buildozer

languages: Markdown Python

repo_name: SamaStolbanutost/kivyGDBrowser


text:
<file_sep># Reach
Extends/Decreases players hit range using a simple plugin.
<file_sep>name: Reach
version: 1.0
author: YonatanX
main: me.yonatanx.Reach.Reach

permissions:
   reach.reach:
      description: Grants you customized reach.

languages: Markdown YAML

repo_name: yoloprobro/Reach


text:
<repo_name>th-ad/rack-reducer<file_sep>/spec/rails_spec.rb
require 'spec_helper'
require_relative 'fixtures'

Process.respond_to?(:fork) && RSpec.describe('in a Rails app') do
  BuildRailsApp = lambda do
    require 'action_controller/railtie'
    require 'securerandom'
    app = Class.new(Rails::Application) do
      routes.append do
        get "/", to: "artists#index"
        get "/query", to: "artists#query"
      end

      config.api_only = true
      config.eager_load = true
      config.secret_key_base = SecureRandom.hex(64)
    end

    ArtistsController = Class.new(ActionController::API) do
      def index
        @artists = Fixtures::ArtistReducer.apply(params)
        render json: @artists
      end

      def query
        @artists = Fixtures::ArtistReducer.apply(request.query_parameters)
        render json: @artists
      end
    end

    app.initialize!
  end

  let(:app) { BuildRailsApp.call }

  it 'works with ActionController::Parameters' do
    pid = Process.fork do
      get('/') { |res| expect(res.status).to eq(200) }
    end
    Process.wait pid
  end

  it 'works with request.query_parameters' do
    pid = Process.fork do
      get('/query') { |res| expect(res.status).to eq(200) }
    end
    Process.wait(pid)
  end

  it 'does not load ActiveSupport into global scope b/c of this spec' do
    expect { ''.blank? }.to raise_error(NoMethodError)
  end
end

repo_language: Ruby

repo_name: th-ad/rack-reducer


text:
<repo_name>mevlutcantuna/netflix-clone<file_sep>/src/types/userType.ts
export interface userType {
  display: string | undefined | null;
  email: string | undefined | null;
  photoURL: string | undefined | null;
  refreshToken: string | undefined | null;
  uid: string | undefined | null;
}
<file_sep>/src/components/search/SearchMovieCard.tsx
import React from "react";
import { SearchedMovieResultTypes } from "../../types/searchedMovieTypes";
import styled from "styled-components";

const StyledCardMain = styled.div``;

const StyledCardImage = styled.img`
  width: 15rem;
  height: 9rem;
  object-fit: cover;
  border-radius: 1rem;
  transition: transform 450ms;
  cursor: pointer;
  padding: 0 0.5rem;
  margin: 1rem 1rem;

  :hover {
    transform: scale(1.3);
  }
`;

interface Props {
  movie: SearchedMovieResultTypes;
  openModal: (id: number) => void;
}

const baseURL = "https://image.tmdb.org/t/p/original/";

const SearchMovieCard: React.FC<Props> = ({ movie, openModal }) => {
  return (

  );
};

export default SearchMovieCard;
<file_sep>/src/components/search/Search.tsx
import React, { useEffect, useState } from "react";

import styled from "styled-components";
import instance from "../../axios";
import {
  SearchedMovieResultTypes,
  SearchedMoviesTypes,
} from "../../types/searchedMovieTypes";
import SearchMovieCard from "./SearchMovieCard";
import TrailerModal from "../trailerModal";

const StyledMovies = styled.div`
  padding-top: 6rem;
  min-height: 100vh;
`;

const StyledTitle = styled.h1`
  color: white;
  font-size: 3rem;
  padding-left: 7%;
  margin-bottom: 2rem;
`;

const StyledCards = styled.div`
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
`;

interface Props {
  search: string;
}

const Search: React.FC<Props> = ({ search }) => {
  const [searchedMovies, setSearchedMovies] = useState<SearchedMoviesTypes>();
  const [isOpenModal, setIsOpenModal] = useState<boolean>(false);
  const [id, setId] = useState<number>(520763);
  const [isLoading, setIsLoading] = useState<boolean>(false);

  const openModal = (id: number) => {
    setId(id);
    setIsOpenModal(true);
  };

  const closeModal = () => {
    setIsOpenModal(false);
  };

  useEffect(() => {
    setIsLoading(true);
    instance
      .get(
        `/search/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&language=en-US&query=${search}`
      )
      .then((res) => {
        setIsLoading(false);
        setSearchedMovies(res.data);
      })
      .catch((err) => {
        setIsLoading(false);
        console.log(err);
      });
  }, [search]);

  return (

        {isLoading ? (

        ) : (

        )}

      <TrailerModal id={id} isOpenModal={isOpenModal} closeModal={closeModal} />
    </StyledMovies>
  );
};

export default Search;
<file_sep>/src/requests.ts
interface IRequests {
  fetchTrending: string;
  fetchNetflixOriginals: string;
  fetchTopRated: string;
  fetchActionMovies: string;
  fetchComedyMovies: string;
  fetchHorrorMovies: string;
  fetchRomanceMovies: string;
  fetchDocumentaries: string;
}

const requests: IRequests = {
  fetchTrending: `/trending/all/week?api_key=${process.env.REACT_APP_TMDB_API_KEY}&language=en-US`,
  fetchNetflixOriginals: `/discover/tv?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_networks=213`,
  fetchTopRated: `/movie/top_rated?api_key=${process.env.REACT_APP_TMDB_API_KEY}&language=en-US`,
  fetchActionMovies: `/discover/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_genres=28`,
  fetchComedyMovies: `/discover/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_genres=35`,
  fetchHorrorMovies: `/discover/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_genres=27`,
  fetchRomanceMovies: `/discover/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_genres=10749`,
  fetchDocumentaries: `/discover/movie?api_key=${process.env.REACT_APP_TMDB_API_KEY}&with_genres=99`,
};

export default requests;
<file_sep>/README.md
# Netflix Clone

### Demo
```
    https://netflix-clone-mct.web.app
```

In this project,I tried to make a Netflix Clone project.I want to  mention some features of the project.Whe you register to the project,your informations is keeping in firebase-firestore and I got all data from tmdb api.
If you want to take a look which its website is ``` https://www.themoviedb.org/```
Also I worked with postman to check incoming data.

## Features
- Login
- Register
- Search Movies
- Watch Trailer of Movies,

## Technologies
- React
- Redux
- Hooks
- Typescript
- Firebase
- Styled-Components
- CSS in Js ( I worked with it some part of project,generally I worked with styled components)
- React-Modal
- React-Router-Dom
- Axios
- Redux-Thunk

## Setup

To setup the project, run the following on your terminal in the order:

```
    git clone https://github.com/mevlutcantuna/netflix-clone
```
```
    npm install
```
```
    yarn start
```
<file_sep>/src/components/auth/SignUp.tsx
import React, { useState } from "react";

import styled from "styled-components";
import firebase from "../../firebase";

const StyledMain = styled.div`
  width: 25rem;
  height: 30rem;
  background-color: black;
  opacity: 0.8;
  z-index: 10;
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  padding: 3rem;
`;

const StyledTitle = styled.div`
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
`;

const StyledInput = styled.input`
  width: 100%;
  height: 2.75rem;
  font-size: 1.25rem;
  padding-left: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.25rem;
  background-color: #e8f0fe;
  opacity: 1;
`;

const StyledButton = styled.button`
  width: 100%;
  height: 2.5rem;
  margin-top: 2rem;
  background-color: #e50914;
  border: none;
  border-radius: 0.25rem;
  color: white;
  cursor: pointer;
`;

const StyledLink = styled.div`
  color: #797979;
  margin-top: 1rem;
  span {
    color: white;
    cursor: pointer;
  }
`;

interface Props {
  changeHaveAccount: () => void;
}

const SignUp: React.FC<Props> = ({ changeHaveAccount }) => {
  const [fullName, setFullName] = useState<string>("");
  const [email, setEmail] = useState<string>("");
  const [password, setPassword] = useState<string>("");

  const handleChangeFullName = (e: React.ChangeEvent<HTMLInputElement>) => {
    setFullName(e.target.value);
  };

  const handleChangeEmail = (e: React.ChangeEvent<HTMLInputElement>) => {
    setEmail(e.target.value);
  };

  const handleChangePassword = (e: React.ChangeEvent<HTMLInputElement>) => {
    setPassword(e.target.value);
  };

  const signUp = (e: React.MouseEvent<HTMLFormElement>) => {
    e.preventDefault();

    if (fullName.trim() && email.trim() && password.trim() !== "") {
      firebase
        .auth()
        .createUserWithEmailAndPassword(email, password)
        .then((res) => {
          res.user?.updateProfile({
            displayName: fullName,
            photoURL:
              "https://upload.wikimedia.org/wikipedia/commons/0/0b/Netflix-avatar.png",
          });
          changeHaveAccount();
        })
        .catch((err) => alert(err));
    } else {
      alert("Please Fill All Inputs Correctly");
    }
  };

  return (

      <form onSubmit={signUp}>

      </form>

    </StyledMain>
  );
};

export default SignUp;
<file_sep>/src/components/trailerModal/index.tsx
import React, { useEffect, useState } from "react";
import Modal from "react-modal";
import instance from "../../axios";

const customStyles = {
  content: {
    top: "50%",
    left: "50%",
    right: "auto",
    bottom: "auto",
    marginRight: "-50%",
    transform: "translate(-50%, -50%)",
    backgroundColor: "#111",
    borderRadius: "1rem",
  },
};

Modal.setAppElement("#root");

interface Props {
  id: number;
  isOpenModal: boolean;
  closeModal: () => void;
}

const TrailerModal: React.FC<Props> = ({ isOpenModal, closeModal, id }) => {
  const [path, setPath] = useState<string>("zrv_SAnnmtk");

  const getTrailerPath = () => {
    instance
      .get(
        "/movie/" + id + "/videos?api_key=" + process.env.REACT_APP_TMDB_API_KEY
      )
      .then((res) => setPath(res.data?.results[1]?.key));
  };

  useEffect(() => {
    getTrailerPath();
  }, [id]);

  return (
    <Modal
      isOpen={isOpenModal}
      onRequestClose={closeModal}
      style={customStyles}
    >
      <iframe
        width="700"
        height="400"
        src={`https://www.youtube.com/embed/${path}?autoplay=1`}
        title="YouTube video player"
        frameBorder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
        allowFullScreen
      />
    </Modal>
  );
};

export default TrailerModal;
<file_sep>/src/components/home/MovieRow.tsx
import React, { useEffect, useState } from "react";

import instance from "../../axios";
import { MovieTypes } from "../../types/movieTypes";
import { MovieResult } from "../../types/movieTypes";
import styled from "styled-components";
import TrailerModal from "../trailerModal";

interface Props {
  title: string;
  fetchUrl: string;
}

const StyledTitle = styled.div`
  font-size: 1.75rem;
  font-weight: bold;
  margin-left: 1rem;
  margin-top: 1rem;
  color: white;
`;

const StyledMovies = styled.div`
  display: flex;
  overflow-x: scroll;
  overflow-y: hidden;

  ::-webkit-scrollbar {
    display: none;
  }
`;

const StyledImage = styled.img`
  width: 15rem;
  height: 9rem;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: transform 450ms;
  cursor: pointer;
  :hover {
    transform: scale(1.3);
  }
`;

const baseURL = "https://image.tmdb.org/t/p/original/";

const MovieRow: React.FC<Props> = ({ title, fetchUrl }) => {
  const [data, setData] = useState<MovieTypes>();
  const [isOpenModal, setIsOpenModal] = useState<boolean>(false);
  const [id, setId] = useState<number>(520763);

  const openModal = (id: number) => {
    setId(id);
    setIsOpenModal(true);
  };

  const closeModal = () => setIsOpenModal(false);

  useEffect(() => {
    instance
      .get(fetchUrl)
      .then((res) => setData(res.data))
      .catch((err) => console.log(err));
  }, [fetchUrl]);

  return (
    <>

      <TrailerModal id={id} isOpenModal={isOpenModal} closeModal={closeModal} />
    </>
  );
};

export default MovieRow;
<file_sep>/src/components/navbar/NavbarModal.tsx
import React, { useEffect, useState } from "react";

import styled from "styled-components";
import firebase from "../../firebase";
import Logout from "../../assets/logout_white_24dp.svg";
import { useHistory } from "react-router-dom";

const StyledModal = styled.div`
  position: absolute;
  top: 2rem;
  right: 0;
  width: 10rem;
  height: 5rem;
  background-color: black;
  color: white;
  border-radius: 0.25rem;
  border: 0.25px black solid;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  z-index: 100;
  div {
    display: flex;
    align-items: center;
    cursor: pointer;

    img {
      margin-right: 1rem;
    }
  }
`;

interface Props {
  changeModal: (situation: boolean) => void;
}

const NavbarModal: React.FC<Props> = ({ changeModal }) => {
  const [profile, setProfile] = useState<string>("");
  const history = useHistory();

  const getProfileName = () => {
    let localProfile = localStorage.getItem("user");
    if (localProfile !== null) {
      let parsedProfileName = JSON.parse(localProfile)?.name;
      setProfile(parsedProfileName);
    }
  };

  const logout = () => {
    firebase
      .auth()
      .signOut()
      .then((res) => {
        localStorage.removeItem("user");
        history.push("/");
      });
  };

  useEffect(() => {
    getProfileName();
  }, []);
  return (

  );
};

export default NavbarModal;
<file_sep>/src/components/navbar/index.tsx
import React, { useEffect, useRef, useState } from "react";

import styled from "styled-components";
import NetflixLogo from "../../assets/Netflix_2015_logo.svg";
import Ring from "../../assets/notifications_white_24dp.svg";
import SearchIcon from "../../assets/search_white_24dp.svg";
import NavbarModal from "./NavbarModal";

const StyledLeftSide = styled.div`
  display: flex;
  img {
    width: 6rem;
    margin-right: 4rem;
  }
`;

const StyledList = styled.ul`
  display: flex;
  align-items: center;
  color: white;

  li {
    margin-right: 1rem;
    cursor: pointer;
  }
`;

const StyledRightSide = styled.div`
  display: flex;
  align-items: center;
  position: relative;

  h3 {
    color: white;
    margin-right: 0.5rem;
    font-weight: normal;
  }
`;

const StyledInput = styled.div`
  width: 15rem;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
  border: white 1px solid;
  background-color: black;
  height: 2.25rem;

  input {
    width: 100%;
    height: 100%;
    background-color: black;
    border: none;
    color: white;
  }

  img {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
  }
`;

const StyledProfile = styled.img`
  width: 2rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  cursor: pointer;
`;

const StyledNavbar = styled.div`
  width: 100%;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
  padding-left: 4rem;
  padding-right: 4rem;
  z-index: 20;
  transition: background-color 1s;
`;

interface Props {
  search: string;
  handleChangeSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
  setSearch: React.Dispatch<React.SetStateAction<string>>;
}

const Navbar: React.FC<Props> = ({ search, handleChangeSearch, setSearch }) => {
  const [profile, setProfile] = useState<string>("");
  const [isOpenSearch, setIsOpenSearch] = useState<boolean>(false);
  const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
  const [show, setShow] = useState<boolean>(false);
  const inputRef = useRef<HTMLInputElement>(null);

  const getProfilePhoto = () => {
    let localProfile = localStorage.getItem("user");
    if (localProfile !== null) {
      let parsedProfileImg = JSON.parse(localProfile)?.photoUrl;
      setProfile(parsedProfileImg);
    }
  };

  const changeSearch = () => {
    setIsOpenSearch((prevState) => !prevState);
  };

  const focusSearch = () => {
    if (inputRef.current !== null && isOpenSearch) {
      return inputRef.current.focus();
    }
  };

  const changeModal = (situation: boolean) => {
    setIsModalOpen(situation);
  };

  const changeScrollColor = () => {
    window.addEventListener("scroll", () => {
      if (window.scrollY > 100) {
        return setShow(true);
      } else return setShow(false);
    });
  };

  const inputBarConstant = () => {
    if (search.trim() !== "") {
      setIsOpenSearch(true);
    }
  };

  useEffect(() => {
    getProfilePhoto();
    changeScrollColor();
    focusSearch();
    inputBarConstant();
  }, [isOpenSearch, search]);

  return (
    // @ts-ignore

      </StyledLeftSide>

        ) : (

        )}

KIDS

    </StyledNavbar>
  );
};

export default Navbar;
<file_sep>/src/App.tsx
import React, { useEffect } from "react";

import Auth from "./pages/Auth";
import { Route } from "react-router-dom";
import { useHistory } from "react-router-dom";
import styled from "styled-components";
import Browser from "./pages/Browser";

const MainStyled = styled.div`
  background: black;
`;

const App: React.FC = () => {
  const history = useHistory();
  const user = localStorage.getItem("user");

  useEffect(() => {
    if (user === null) {
      history.push("/");
    }
  }, [history, user]);

  return (
    <MainStyled>
      <Route exact path="/" component={Auth} />
      <Route exact path="/browser" component={Browser} />
    </MainStyled>
  );
};
export default App;
<file_sep>/src/redux/actions/user.ts
import { DELETE_USER, SAVE_USER } from "../constants/user";
import { userType } from "../../types/userType";

export const saveUser = (user: userType) => {
  return {
    type: SAVE_USER,
    payload: user,
  };
};

export const deleteUser = () => {
  return {
    type: DELETE_USER,
    payload: "Silinecek data",
  };
};
<file_sep>/src/pages/Browser.tsx
import React, { useEffect, useState } from "react";
import Navbar from "../components/navbar";
import Home from "../components/home/Home";
import Search from "../components/search/Search";

const Browser: React.FC = () => {
  const [isSearching, setIsSearching] = useState<boolean>(false);
  const [search, setSearch] = useState<string>("");

  const handleChangeSearch = (e: React.ChangeEvent<HTMLInputElement>) => {
    setSearch(e.target.value);
  };

  useEffect(() => {
    if (search.trim() !== "") {
      setIsSearching(true);
    } else {
      setIsSearching(false);
    }
  }, [search]);

  return (
    <>
      <Navbar
        search={search}
        setSearch={setSearch}
        handleChangeSearch={handleChangeSearch}
      />
      {!isSearching ? <Home /> : <Search search={search} />}
    </>
  );
};

export default Browser;
<file_sep>/src/firebase.ts
import firebase from "firebase/app";
import 'firebase/auth';

const firebaseConfig = {
    apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
    authDomain: process.env.REACT_APP_AUTH_DOMAIN,
    projectId: process.env.REACT_APP_PROJECT_ID,
    storageBucket: process.env.REACT_APP_STORAGE_BUCKET,
    messagingSenderId: process.env.REACT_APP_MESSAGE_SENDER_ID,
    appId: process.env.REACT_APP_APP_ID
};

firebase.initializeApp(firebaseConfig);

export default firebase;<file_sep>/src/components/home/Video.tsx
import React, { useEffect, useState } from "react";

import { MovieResult } from "../../types/movieTypes";
import instance from "../../axios";
import requests from "../../requests";
import styled from "styled-components";

const StyledTitle = styled.h1`
  color: white;
  padding-left: 4rem;
  padding-bottom: 1rem;
  font-size: 4rem;
  font-weight: 800;
`;

const StyledButtonsDiv = styled.div`
  padding-left: 4rem;
  padding-bottom: 3rem;
`;

const StyledButton = styled.button`
  cursor: pointer;
  color: white;
  border: none;
  font-weight: 700;
  border-radius: 0.5rem;
  margin-right: 1rem;
  padding: 1.25rem 2.5rem;
  background-color: rgba(51, 51, 51, 0.5);

  :hover {
    color: black;
    background-color: white;
    transition: all 0.5s;
  }
`;

const StyledDesc = styled.div`
  color: white;
  padding-left: 4rem;
  width: 50rem;
  line-height: 1.3;
  padding-bottom: 0.3rem;
  font-size: 1.5rem;
  height: 80px;
`;

const StyledBottom = styled.div`
  width: 100%;
  position: absolute;
  bottom: 0;
  height: 8rem;
  font-size: 4rem;
  color: white;
  background-image: linear-gradient(
    180deg,
    transparent,
    rgba(37, 37, 37, 0.61),
    #111
  );
`;

const StyledMain = styled.div`
  position: relative;
  width: 100%;
  height: 38rem;
  //background-image: url();
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
`;

const Video: React.FC = () => {
  const [video, setVideo] = useState<MovieResult>();
  const imageUrl = "https://image.tmdb.org/t/p/original" + video?.backdrop_path;

  const truncate = (str: string, n: number) => {
    return str?.length > n ? str.substr(0, n - 1) + "..." : str;
  };

  const styledNavbarBackground = {
    backgroundImage: "url(" + imageUrl + ")",
  };

  useEffect(() => {
    instance
      .get(requests.fetchNetflixOriginals)
      .then((res) =>
        setVideo(
          res.data.results[Math.floor(Math.random() * res.data.results.length)]
        )
      )
      .catch((err) => console.log(err));
  }, []);

  // @ts-ignore
  return (

      </StyledButtonsDiv>

  );
};

export default Video;
<file_sep>/src/redux/reducers/user.ts
import { DELETE_USER, SAVE_USER } from "../constants/user";
import { ActionTypes } from "../../types/actionsTypes";
import { userType } from "../../types/userType";

interface State {
  user: userType | object;
}

const initialState: State = {
  user: {},
};

const userReducer = (state = initialState, action: ActionTypes) => {
  switch (action.type) {
    case SAVE_USER:
      return { ...state, user: action.payload };
    case DELETE_USER:
      return state;
    default:
      return state;
  }
};

export default userReducer;
<file_sep>/src/components/home/Home.tsx
import React from "react";

import Video from "./Video";
import MovieRow from "./MovieRow";
import requests from "../../requests";

const Home: React.FC = () => {
  return (
    <>
      <Video />
      <MovieRow
        title="Netflix Originals"
        fetchUrl={requests.fetchNetflixOriginals}
      />
      <MovieRow title="Trends" fetchUrl={requests.fetchTrending} />
      <MovieRow title="Top Rated" fetchUrl={requests.fetchTopRated} />
      <MovieRow title="Action Movies" fetchUrl={requests.fetchActionMovies} />
      <MovieRow title="Comedy Movies" fetchUrl={requests.fetchComedyMovies} />
      <MovieRow title="Horror Movies" fetchUrl={requests.fetchHorrorMovies} />
      <MovieRow title="Documentaries" fetchUrl={requests.fetchDocumentaries} />
    </>
  );
};

export default Home;
<file_sep>/src/pages/Auth.tsx
import React, { useState } from "react";

import Image from "../assets/auth-bg.jpg";
import NetflixLogo from "../assets/Netflix_2015_logo.svg";
import styled from "styled-components";
import SignIn from "../components/auth/SignIn";
import SignUp from "../components/auth/SignUp";

const StyledMain = styled.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  position: relative;
  background-color: black;

  img {
    top: 0;
    left: 0;
    position: absolute;
    width: 100vw;
    height: 100vh;
    opacity: 0.5;
  }
`;

const StyledNavbar = styled.div`
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2rem;
  height: 5rem;

  img {
    margin-top: 1rem;
    padding-left: 2rem;
    width: 14rem;
    height: 3rem;
    opacity: 1;
  }
`;

const Auth: React.FC = () => {
  const [haveAccount, setHaveAccount] = useState<boolean>(false);

  const changeHaveAccount = () => {
    setHaveAccount((prevState) => !prevState);
  };

  return (

      {haveAccount ? (
        <SignUp changeHaveAccount={changeHaveAccount} />
      ) : (
        <SignIn changeHaveAccount={changeHaveAccount} />
      )}
    </StyledMain>
  );
};

export default Auth;
<file_sep>/src/redux/constants/user.ts
export const SAVE_USER = "SAVE_USER";
export const DELETE_USER = "DELETE_USER";
<file_sep>/src/components/auth/SignIn.tsx
import React, { useState } from "react";

import styled from "styled-components";
import firebase from "../../firebase";
import { useHistory } from "react-router-dom";
import { userType } from "../../types/userType";
import { useDispatch } from "react-redux";
import { saveUser } from "../../redux/actions/user";

const StyledMain = styled.div`
  width: 25rem;
  height: 30rem;
  background-color: black;
  opacity: 0.8;
  z-index: 10;
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  padding: 3rem;
`;

const StyledTitle = styled.div`
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
`;

const StyledInput = styled.input`
  width: 100%;
  height: 2.75rem;
  font-size: 1.25rem;
  padding-left: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.25rem;
  background-color: #e8f0fe;
  opacity: 1;
`;

const StyledButton = styled.button`
  width: 100%;
  height: 2.5rem;
  margin-top: 2rem;
  background-color: #e50914;
  border: none;
  border-radius: 0.25rem;
  color: white;
  cursor: pointer;
`;

const StyledLink = styled.div`
  color: #797979;
  margin-top: 1rem;
  span {
    color: white;
    cursor: pointer;
  }
`;

interface Props {
  changeHaveAccount: () => void;
}

const SignIn: React.FC<Props> = ({ changeHaveAccount }) => {
  const [email, setEmail] = useState<string>("");
  const [password, setPassword] = useState<string>("");
  const history = useHistory();
  const dispatch = useDispatch();

  const handleChangeEmail = (e: React.ChangeEvent<HTMLInputElement>) => {
    setEmail(e.target.value);
  };

  const handleChangePassword = (e: React.ChangeEvent<HTMLInputElement>) => {
    setPassword(e.target.value);
  };

  const createUserInLocalStorage = (
    name: string = "",
    email: string = "",
    photoUrl: string = ""
  ) => {
    const user = JSON.stringify({
      name,
      email,
      photoUrl,
    });

    localStorage.setItem("user", user);
  };

  const saveUserToStore = ({
    display,
    email,
    photoURL,
    refreshToken,
    uid,
  }: userType) => {
    const user = { display, email, photoURL, refreshToken, uid };
    dispatch(saveUser(user));
  };

  const singIn = (e: React.MouseEvent<HTMLFormElement>) => {
    e.preventDefault();
    if (email.trim() && password.trim() !== "") {
      firebase
        .auth()
        .signInWithEmailAndPassword(email, password)
        .then((res) => {
          createUserInLocalStorage(
            res.user?.displayName?.toString(),
            res.user?.email?.toLowerCase(),
            res.user?.photoURL?.toString()
          );
          saveUserToStore({
            display: res.user?.displayName,
            email: res.user?.email,
            photoURL: res.user?.photoURL,
            refreshToken: res.user?.refreshToken,
            uid: res.user?.uid,
          });
          history.push("/browser");
        })
        .catch((err) => alert(err));
    } else {
      alert("Please Fill All Inputs Correctly");
    }
  };

  return (

      <form onSubmit={singIn}>

      </form>

    </StyledMain>
  );
};

export default SignIn;
<file_sep>/src/types/actionsTypes.ts
import { DELETE_USER, SAVE_USER } from "../redux/constants/user";
import { userType } from "./userType";

interface SaveActionType {
  type: typeof SAVE_USER;
  payload: userType | object;
}

interface DeleteActionType {
  type: typeof DELETE_USER;
  payload: userType | object;
}

export type ActionTypes = SaveActionType | DeleteActionType;

languages: Markdown TypeScript TSX

repo_name: mevlutcantuna/netflix-clone


text:
<file_sep>import sys
import getopt
import os
import Checksum
import BasicSender

'''
This is a skeleton sender class. Create a fantastic transport protocol here.
'''
class Sender(BasicSender.BasicSender):
    def __init__(self, dest, port, filename, debug=False, sackMode=False):
        super(Sender, self).__init__(dest, port, filename, debug)
        self.sackMode = sackMode
        self.debug = debug

    # Main sending loop.
    def start(self):

        initilize = self.make_packet("syn",0,"")
      #  print("self",self.infile)
        self.send(initilize)
        rec_init = self.receive(0.5)
        seq_num = 0
        sack_mode = False
        if(rec_init != None):
            rec_init_list = rec_init.split("|")
            rec_type = rec_init_list[0]
            if(rec_type !="sack"):

              seq_num = int(rec_init_list[1])
            else:
                sack_mode = True
                seq_num = 1

        while(seq_num == 0):
            initilize = self.make_packet("syn", 0, "")
            #  print("self",self.infile)
            self.send(initilize)

            rec_init = self.receive(0.5)
            if(rec_init != None):

                rec_init_list = rec_init.split("|")
                if( rec_init_list[0]!="sack"):

                    seq_num = int(rec_init_list[1])
                else:
                    sack_mode = True
                    semicollon = rec_init_list[1].find(';')

                    seq_num = int(rec_init_list[1][:semicollon])

        packets = [0]
        while True:
            data = self.infile.read(1450)
            packets.append( data)
            if(len(data) < 1450):
                break

        while True:
            data = packets[seq_num]
         #   print("data",data)
     #       print("seq",seq_num)
            if(len(data) < 1450):

                end = self.make_packet("fin", seq_num, data)
                self.send(end)
                end_ack = self.receive(0.5)
                if(end_ack!=None):
                    rec_end_list = end_ack.split("|")
                    if(not sack_mode):

                        seq_num = int(rec_end_list[1])
                        break
                    else:

                        semicollon = rec_end_list[1].find(';')

                        seq_num = int(rec_end_list[1][:semicollon])
                        break
               # dat2 = self.receive()

            else:
                dat = self.make_packet("dat", seq_num, packets[seq_num])
                self.send(dat)
                data_ack = self.receive(0.5)

                if(data_ack !=None):
                    rec_data_list = data_ack.split("|")
                    if(not sack_mode):

                        seq_num = int(rec_data_list[1])
                    else:
                        semicollon = rec_data_list[1].find(';')

                        seq_num = int(rec_data_list[1][:semicollon])

'''
This will be run if you run this script from the command line. You should not
change any of this; the grader may rely on the behavior here to test your
submission.
'''
if __name__ == "__main__":
    def usage():
        print "BEARS-TP Sender"
        print "-f FILE | --file=FILE The file to transfer; if empty reads from STDIN"
        print "-p PORT | --port=PORT The destination port, defaults to 33122"
        print "-a ADDRESS | --address=ADDRESS The receiver address or hostname, defaults to localhost"
        print "-d | --debug Print debug messages"
        print "-h | --help Print this usage message"
        print "-k | --sack Enable selective acknowledgement mode"

    try:
        opts, args = getopt.getopt(sys.argv[1:],
                               "f:p:a:dk", ["file=", "port=", "address=", "debug=", "sack="])
    except:
        usage()
        exit()

    port = 33122
    dest = "localhost"
    filename = None
    debug = False
    sackMode = False

    for o,a in opts:
        if o in ("-f", "--file="):
            filename = a
        elif o in ("-p", "--port="):

            port = int(a)
        elif o in ("-a", "--address="):
            dest = a
        elif o in ("-d", "--debug="):
            debug = True
        elif o in ("-k", "--sack="):
            sackMode = True

    s = Sender(dest,port,filename,debug, sackMode)
    try:
        s.start()
    except (KeyboardInterrupt, SystemExit):
        exit()

repo_language: Python

repo_name: sparrowV/rtp


text:
<file_sep># Dev
First Rep

repo_name: vaughnstevenc/Dev


text:
<file_sep># Keypirinha

A semantic launcher for Windows

* Website:
  http://keypirinha.com
* Support Chat Room:
  https://gitter.im/Keypirinha/Keypirinha
* Report an issue:
  https://github.com/Keypirinha/Keypirinha/issues


text:
<repo_name>siddhiwesanekar/xyz123<file_sep>/model.py
import tensorflow as tf
import nltk
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy as np
import tflearn
import random
import json

bot_name = "SmartBot"
with open('teamcenter_data.json', 'r') as f:
    intents = json.load(f)

words = []
parent_classes = []
classes = []
documents = []
ignore = ['?','!','*']
for intent in intents['intents']:
    for pattern in intent['patterns']:

        w = nltk.word_tokenize(pattern)

        words.extend(w)

        documents.append((w, intent['tag']))

        if intent['tag'] not in classes:
            classes.append(intent['tag'])
        if intent['parent_tag'] not in parent_classes:
            parent_classes.append((intent['parent_tag']))

words = [stemmer.stem(w.lower()) for w in words if w not in ignore]
words = sorted(list(set(words)))

# remove duplicate classes
classes = sorted(list(set(classes)))
parent_classes = sorted(list(set(parent_classes)))

print (len(documents), "documents")
print (len(classes), "classes", classes)
print (len(words), "unique stemmed words", words)
print (len(parent_classes), "parent classes", parent_classes)

training = []
output = []
# create an empty array for output
output_empty = [0] * len(classes)
output_empty_1 = [0] * len(parent_classes)

# create training set, bag of words for each sentence
for doc in documents:
    # initialize bag of words
    bag = []
    # list of tokenized words for the pattern
    pattern_words = doc[0]
    # stemming each word
    pattern_words = [stemmer.stem(word.lower()) for word in pattern_words]
    # create bag of words array
    for w in words:
        bag.append(1) if w in pattern_words else bag.append(0)

    # output is '1' for current tag and '0' for rest of other tags
    output_row = list(output_empty)
    output_row[classes.index(doc[1])] = 1
    output_row_1 = list(output_empty_1)
   # output_row_1[parent_classes.index((doc[2]))] = 1
    training.append([bag, output_row])

# shuffling features and turning it into np.array
random.shuffle(training)
training = np.array(training)

# creating training lists
train_x = list(training[:,0])
train_y = list(training[:,1])

from tensorflow.python.framework import ops

ops.reset_default_graph()

#tf.reset_default_graph()

# Building neural network
net = tflearn.input_data(shape=[None, len(train_x[0])])
net = tflearn.fully_connected(net, 10)
net = tflearn.fully_connected(net, 10)
net = tflearn.fully_connected(net, len(train_y[0]), activation='softmax')
net = tflearn.regression(net)

# Defining model and setting up tensorboard
model = tflearn.DNN(net, tensorboard_dir='tflearn_logs')

# Start training
model.fit(train_x, train_y, n_epoch=1000, batch_size=8, show_metric=True)
model.save('model.tflearn')

import pickle
pickle.dump( {'words':words, 'classes':classes,'parent_classes':parent_classes , 'train_x':train_x, 'train_y':train_y}, open( "training_data_old", "wb" ) )
<file_sep>/requirements.txt
cx-Freeze==6.7

gunicorn
python-dotenv
cryptography
Flask
flatbuffers==1.12
future==0.18.2
idna==3.2
importlib-metadata==4.8.1
Jinja2==3.0.1
joblib==1.0.1
keras==2.6.0
keras-nightly==2.7.0.dev2021090307
Keras-Preprocessing==1.1.2
nltk==3.6.2
numpy==1.19.5
pandas
python-dateutil
pytz
PyYAML
random2
requests
requests-oauthlib
rsa
six
SQLAlchemy
tensorflow == 2.6.0
tensorflow-estimator
tensorflow-probability
tensorflow-io-gcs-filesystem
termcolor
textblob
tensorflow-gpu
tflearn
tqdm
typing-extensions
urllib3
virtualenv

languages: Text Python

repo_language: Text


text:
<repo_name>zyhou/integration-test-rest-api<file_sep>/src/index.js
import express from "express";

import { usersRouter } from "./users.js";

const app = express();
const port = 3000;

app.get("/", (req, res) => {
  res.send("Hello World!");
});

app.use("/users", usersRouter);

app.listen(port, () => {
  console.log(`Listening at http://localhost:${port}`);
});
<file_sep>/integration-tests/users.spec.js
import frisby from "frisby";
const Joi = frisby.Joi; // Frisby exposes Joi for convenience

const address = Joi.object({
  street: Joi.string().required(),
  suite: Joi.string().required(),
  city: Joi.string().required(),
  zipcode: Joi.string().required(),
  geo: {
    lat: Joi.string().required(),
    lng: Joi.string().required(),
  },
});

const company = Joi.object({
  name: Joi.string(),
  catchPhrase: Joi.string(),
  bs: Joi.string(),
});

const user = Joi.object({
  id: Joi.number().required(),
  name: Joi.string().required(),
  username: Joi.string().required(),
  email: Joi.string().email(),
  phone: Joi.string().required(),
  website: Joi.string().uri({ allowRelative: true }).required(),
  address,
  company,
});

describe("/users routes", () => {
  describe("GET /", () => {
    it("should return valid users list", function () {
      return frisby
        .get("http://localhost:3000/users")
        .expect("status", 200)
        .expect("jsonTypesStrict", "*", user);
    });
  });

  describe("GET /:id", () => {
    it("should return valid user", function () {
      return frisby
        .get("http://localhost:3000/users/1")
        .expect("status", 200)
        .expect("jsonTypesStrict", user);
    });

    it("should return 404 if user doesn't exist", function () {
      return frisby
        .get("http://localhost:3000/users/999")
        .expect("status", 404)
        .expect("bodyContains", "Not found");
    });
  });
});
<file_sep>/README.md
# Integration test on Node API

This project show how to use [frisby](https://github.com/vlucas/frisby) and [joi](https://github.com/sideway/joi) to test your Node API.

## Prerequisites

- Node 14.x or more
- Yarn 1.x

## Start the API

```sh
yarn # Install the dep

yarn dev # start the API on localhost:3000 in watch mode

yarn start # start the API on localhost:3000 (production)
```

Routes:

```
GET -> / -> Return Hello World

GET -> /users -> Return the list of all users

GET -> /users/:id -> Return the user by this :id
```

## Unit test

```sh
yarn test:unit:watch # Start unit test in watch mode

yarn test:unit # Start unit test, CI command
```

The tests can be found in `./src/**/*.spec.js`

## Integration test

These command start the API in production node (`yarn start`), wait for it to be launched (`start-server-and-test` dependency) and start the integration tests.

```sh
yarn test:integration:watch # Start integration test in watch mode

yarn test:integration:ci # Start integration test, CI command
```

The tests can be found in `./integration-tests/**/*.spec.js`
<file_sep>/jest.integration.config.js
export default {
  verbose: true,
  testMatch: ["<rootDir>/integration-tests/**/*.spec.js"],
};

languages: Markdown JavaScript

repo_name: zyhou/integration-test-rest-api