View .yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
networks: | |
graynet: | |
driver: bridge | |
# This is how you persist data between container restarts | |
volumes: | |
mongo_data: | |
driver: local |
View gist:f5754a045225a588c8aa1236245ec057
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my-app | |
├── Dockerfile | |
├── docker-compose.yml | |
├── node_modules/ | |
├── package.json | |
├── spec | |
├── src | |
├── yarn.lock |
View luhn-algorithm-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validateCreditCardNumber = require('./luhn-algorithm'); | |
// Bu tool ile Credit Card Numarası Üretip Fonksiyonu Test Edebiliriz | |
// https://www.creditcardvalidator.org/generator | |
console.log(validateCreditCardNumber("4532201414641731")); // Visa = true | |
console.log(validateCreditCardNumber("5316400776001851")); // MasterCard = true | |
console.log(validateCreditCardNumber("379727417901957")); // Amex = true | |
console.log(validateCreditCardNumber("6222021199044319")); // UnionPay = true | |
console.log(validateCreditCardNumber("3016364233432398")); // Diners = true |
View luhn-algorithm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Validation For Credit Card Numbers Using Luhn Algorithm | |
const validateCreditCardNumber = (input) => { | |
// Kredi kartı numarasını sayısal bir diziye dönüştürme | |
let creditCardInt = input.split("").map(Number); | |
// Luhn Algoritması gereği her ikinci basamağı sondan başlayarak ikiyle çarparız | |
for (let i = creditCardInt.length - 2; i >= 0; i = i - 2) { | |
// Seçilen her ikinci basamağı geçici bir değişkende saklarız | |
let tempValue = creditCardInt[i]; |
View folder-tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dev | |
├── build | |
│ └── logs | |
│ │ └── debug_a.log | |
│ │ └── debug_b.log | |
│ │ └── debug_c.log | |
│ | |
├── tests | |
│ └── test1.js | |
│ └── test2.js |
View . React kullanımı, react'ın temel kavramları.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bu Gists ile React'te temel kavramları not edelim. Çalışacağımız konu başlıkları: | |
- Install React | |
- JSX | |
- Components | |
- Props | |
- States | |
- Redux | |
- Redux Toolkit | |
- Hooks |
View state-hook.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
function Example() { | |
// Declare a new state variable, which we'll call "count" | |
const [count, setCount] = useState(0); | |
return ( | |
<div> | |
<p>You clicked {count} times</p> | |
<button onClick={() => setCount(count + 1)}> |
View key.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "react"; | |
class Tweet extends Component { | |
render() { | |
return ( | |
<div> | |
{this.props.tweet.map(tweet => | |
<div key={tweet.tweet_id}> | |
{tweet.tweet_topic} | |
<br /> | |
{tweet.tweet_detail} |
View .js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Tweet from '../component/Tweet'; | |
const tweet = [ | |
{ | |
tweet_id: 1, | |
tweet_topic: "Sports", | |
tweet_detail: "Liverpool, Manchester City ile arasındaki puan farkını 1'e düşürdü." | |
}, | |
{ | |
tweet_id: 2, |
View .js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constructor(props) { | |
super(props); | |
this.state = { | |
categories: | |
[ | |
{categoryId: 1, categoryName: "Sports" }, | |
{categoryId: 2, categoryName: "Economy"} | |
] | |
}; | |
} |
NewerOlder