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
from flask_sqlalchemy import SQLAlchemy | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////Users/bozkurt/Desktop/veritabani.db' | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True | |
db = SQLAlchemy(app) | |
class users(db.Model): |
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
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://root:[password]@157.230.61.38:5432/davetiyem_db' | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True | |
db = SQLAlchemy(app) | |
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
useEffect(async () => { | |
const result = await Axios( | |
'https://practical-react-server.herokuapp.com/v1/post/', | |
); | |
setLoad(false); | |
setPosts(result.data); | |
const response = await Axios("https://practical-react-server.herokuapp.com/v1/auth/") |
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, { useEffect } from 'react'; | |
import Axios from 'axios'; | |
import Cookies from 'js-cookie'; | |
import jwtDecode from 'jwt-decode'; | |
import Pagination from 'pagination-react-hooks'; | |
import { useSelector, useDispatch } from 'react-redux'; | |
const Content = ({ posts, setLoad, setPosts, loading, owner, setOwner }) => { | |
const yazilar = useSelector( state => state.posts ) |
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
module.exports = { | |
consumer_key:'XXXX', | |
consumer_secret:'XXXXXXXX', | |
access_token:'XXXX-XXXXX', | |
access_token_secret:'XXXXX' | |
} |
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
let params = { | |
q: 'evleniyorum', | |
count: 15, | |
result_type: 'recent', | |
} | |
twit.get('search/tweets', params, (err, data, response) => { | |
let tweets = data.statuses | |
var sayac = 0; | |
for (let dat of tweets) { | |
let username = dat.user.screen_name |
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 from 'react' | |
import Axios from 'axios' | |
function HomePage() { | |
const uploadImage = e => { | |
const formData = new FormData() | |
formData.append('gelinFoto', e.target.files[0]) | |
Axios.post( | |
`http://localhost:3000/upload`, |
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
var whitelist = [ | |
'https://site2.com', | |
'http://site1.com', | |
'http://0.0.0.0:3000' | |
] | |
var corsOptions = { | |
origin: function(origin, callback) { | |
var originIsWhitelisted = whitelist.indexOf(origin) !== -1 | |
callback(null, originIsWhitelisted) |
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 getData = async () => { | |
const response = await Axios.get( | |
`${config.apiURL}${config.version}users/${userid}` | |
) | |
if (response.data.status == 201) { | |
setLoad({ load: true, check: true }) | |
setCheckUserID(response.data.userid) | |
} else { | |
setLoad({ load: true, check: false }) | |
} |
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 from 'react'; | |
import { | |
SafeAreaView, | |
AsyncStorage, | |
ScrollView, | |
Dimensions, | |
BackHandler, | |
Alert, | |
StatusBar, | |
} from 'react-native'; |
OlderNewer