Skip to content

Instantly share code, notes, and snippets.

@gokhancerk
gokhancerk / index.html
Created April 16, 2020 12:51
Basic To Do script on VanillaJS without ui
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ToDo</title>
</head>
<body>
<div>
@gokhancerk
gokhancerk / index.html
Created April 21, 2020 13:32
Responsive Website Layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="rwl.css">
<title>Responsive Website Layout</title>
</head>
<body>
<?php
$house = file_get_contents('https://www.potterapi.com/v1/sortingHat?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS');
?>
<p>Tebrikler! Seçmen şapka sizi <?php echo $house; ?>evine yerleştirdi.</p>
<?php
$characters = file_get_contents('https://www.potterapi.com/v1/characters?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS');
$houses = file_get_contents('https://www.potterapi.com/v1/houses?key=$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS');
if (isset($_GET['house']) == NULL){
array_filter($characterDetails,function ($v,$k){?>
<tr>
<th scope="row"><?php echo $k; ?></th>
<td><?php echo $v['name']; ?></td>
<td><?php echo $v['role']; ?></td>
<td><?php echo $v['house']; ?></td>
<td><?php echo $v['bloodStatus']; ?></td>
<td><?php echo $v['species']; ?></td>
</tr>

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gokhancerk
gokhancerk / regex.md
Last active May 24, 2020 10:39
regex

Fixed string comparison

string comparisons

$name = "Dave";

if($name == "Dave")

@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 / 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 / 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 / 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);