Skip to content

Instantly share code, notes, and snippets.

@gokhancerk
gokhancerk / index.html
Last active March 1, 2021 08:22
vue lifecycle hooks
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Basics</title>
<link
href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
rel="stylesheet"
/>
@gokhancerk
gokhancerk / poll-app.js
Created November 9, 2020 13:03
call,bind,apply practice no ui poll app
const poll = {
question: 'What is your favourite programming language?',
options: ['0: JavaScript', '1: Python', '2: Rust', '3: C++'],
// This generates [0, 0, 0, 0]. More in the next section!
answers: new Array(4).fill(0),
/**
* Display a prompt window for the user to input the number of the selected option.
* @param {*} params
*/
registerNewAnswer() {
@gokhancerk
gokhancerk / index.html
Created October 30, 2020 14:25
Playground-React App
<div id="root"></div>
<div class="person">
<h1>Max Verstappen</h1>
<p>Your Age: 30</p>
</div>
<div class="person">
<h1>Lewis Hamilton</h1>
<p>Your Age: 35</p>
@gokhancerk
gokhancerk / .eslintrc.json
Created October 20, 2020 10:44
my eslintrc
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
// "plugins": [],
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12
@gokhancerk
gokhancerk / Caesar.c
Created September 16, 2020 22:32
cs50 my Caesar task solution
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, string argv[])
{
int key;
if(argc == 2 && atoi(argv[1]) >= 0 && atoi(argv[1]))
{
@gokhancerk
gokhancerk / vigenere.c
Created September 11, 2020 19:44
cs50 my vigenere task solution
//https://pastebin.pl/view/0cdfb99e
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
bool checkKeyword(string key);
int shiftValue(char c);
void cipher(char plainText, int key);
@gokhancerk
gokhancerk / app.js
Created August 14, 2020 14:09
class component
import React, { Component } from 'react';
import './App.css';
import Person from './Person/Person';
import { Button } from 'react-bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
class App extends Component {
state = {
persons : [
{ name: 'Max', age: 29},
@gokhancerk
gokhancerk / app.js
Created August 14, 2020 14:06
functional component
import React, { useState } from 'react';
import './App.css';
import Person from './Person/Person';
import { Button } from 'react-bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
const App = (props) => {
const [ personsState, setPersonsState] = useState({
persons : [
@gokhancerk
gokhancerk / reducer.js
Last active July 20, 2020 17:36
immutable
const initialBoardState = {
columns: [
{
columnID: 1,
columnName: 'Pazartesi',
cards: [
{
// task:'Column Feature',
// person: 'John',
@gokhancerk
gokhancerk / regex.md
Last active May 24, 2020 10:39
regex

Fixed string comparison

string comparisons

$name = "Dave";

if($name == "Dave")