Skip to content

Instantly share code, notes, and snippets.

View mksglu's full-sized avatar

Mert Köseoğlu mksglu

View GitHub Profile
@mksglu
mksglu / Linux I3WM Status Temperature
Last active November 12, 2017 18:03
Linux I3WM dizin/pencere yöneticisinde sıcaklık değerlerini gösterelim.
# /etc/i3status.conf
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"
@mksglu
mksglu / Arch Linux'ta DNS Sunucularını Güncellemek
Created November 8, 2017 10:18
Arch Linux'ta DNS sunucularının değiştirilmesine yönelik komutlar yer almaktadır.
sudo nano /etc/resolv.conf
# Generated by resolvconf
NetworkManager
nameserver 8.8.8.8
nameserver: 8.8.4.4
sudo chattr +i /etc/resolv.conf
sudo systemctl restart NetworkManager.service
@mksglu
mksglu / Packages For Arch Linux
Created November 11, 2017 12:43
Packages I use on Arch Linux Kernel 4.13
aalib
acl
acpi
acpid
adwaita-icon-theme
alsa-lib
alsa-plugins
alsa-utils
apm
appstream-glib
@mksglu
mksglu / nginx.conf
Last active April 24, 2018 13:45
CakePHP 3 and WordPress On Nginx Server - This is a simple Nginx configuration file. On the server, it will work in the WordPress sub-directory and CakePHP3 in the root directory. 
server {
listen 80;
root /var/www/httdocs;
index index.php index.html index.htm index.nginx-debian.html;
server_name <server_name>;
@mksglu
mksglu / react-authentication-folder-structure.md
Last active September 21, 2023 07:11
React JS Authenatication Folder Structure

React JS Authenatication + REST API

Used Packages

  • React JS
  • Redux Thunk
  • Redux Form
  • Redux Logger
import React from 'react'
import { connect } from 'react-redux'
import { Redirect, Route } from 'react-router-dom'
const PrivateRoute = ({ component: Component, ...rest }) => {
const { authentication } = rest
return (
<Route
{...rest}
render={props =>
@mksglu
mksglu / LoadingHOC.tsx
Created August 4, 2018 19:10
ReactJS and TypeScript High Order Component (HOC) Loading Spinner
import * as React from 'react';
interface IProps {
propName?: any;
loadingTime?: boolean;
}
const loadingHOC = ({ propName, loadingTime = false }: IProps) => <
P extends {}
>(
WrappedComponent: React.ComponentClass<P> | React.StatelessComponent<P>
@mksglu
mksglu / login.feature
Last active August 5, 2018 12:26
Behavior Driven Development and CucumberJS
Feature: Logging User
Scenario: Successfuly User Logged
Given Username is "mksglu"
And password is 123456
When the user is logging in
Then the user should be logged in
| attribute | type | value |
| Role | numeric | 1 |
| Auth | boolean | true |
| User | string | test12 |
process.env.NODE_ENV = "test";
import * as mongoose from "mongoose";
import * as request from "supertest";
import server from "../../app";
import { INVITE_EMAIL, mockUser } from "../../utils/test.utils";
describe("Users Route", () => {
let token, id, mailConfirm: string;
describe("/POST users", () => {
it("it should add a new user", done => {
request(server)