Skip to content

Instantly share code, notes, and snippets.

View ebrugulec's full-sized avatar
💃

Ebru Gulec ebrugulec

💃
  • Berlin, Germany
View GitHub Profile
class MyComponent extends Component {
componentDidMount() {
// verileri çekmek için api listener ekledik
// mouse hareketleri için event listener ekledik.
}
componentWillUnmount() {
// api listener'ı kaldır
// event listener'ı kaldır
}
import React, { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>{count}</p>
<button onClick={() => setCount(count + 1)}>
Click me
import React from 'react';
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0,
};
}
import React from 'react'
const Row = props => {
return(
<div>
{props.children}
</div>
)
}
import React, { Component } from 'react';
import Row from './Row'
class App extends Component {
constructor(props){
super(props)
this.state = {
name: 'Ebru',
}
// this.handleNameChange = this.handleNameChange.bind(this)
this.setState ( {
clicked: true,
}, () => {
console.log('the state is now', this.state)
const formatCurrency = function(
currencySymbol,
decimalSeparator ) {
return function( value ) {
const wholePart = Math.trunc( value / 100 );
let fractionalPart = value % 100;
if ( fractionalPart < 10 ) {
fractionalPart = '0' + fractionalPart;
}
return `${currencySymbol}${wholePart}${decimalSeparator}${fractionalPart}`;
handleScanner = () => {
const formData = new FormData();
formData.append("file", this.state.files[0]);
formData.append("tags", 'text_detection');
formData.append("upload_preset", {UPLOAD_PRESENT_ID});
formData.append("api_key", API_KEY);
formData.append("timestamp", (Date.now() / 1000) | 0);
axios.post(
"https://api.cloudinary.com/v1_1/{YOUR_USERNAME}/image/upload"",
<FilePond
onupdatefiles={(fileItems) => {
this.setState({
files: fileItems.map(fileItem => fileItem.file)
});
}}
onDrop={this.handleUploadImages}/>
sudo dpkg -i <package_name>.deb