Skip to content

Instantly share code, notes, and snippets.

View mrkacan's full-sized avatar
🏠
Working from home

Emre Kaçan mrkacan

🏠
Working from home
View GitHub Profile
@mrkacan
mrkacan / media-query.css
Created May 2, 2023 10:00 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@mrkacan
mrkacan / FormikFormExample.js
Created May 2, 2021 07:15
Formik form example with using custom hooks.
import React from "react";
import { useFormik } from "formik";
export default () => {
const { handleChange, handleSubmit, values, errors } = useFormik({
validationSchema: userInfoSchema,
initialValues: {
firstName: "",
lastName: "",
email: ""
@mrkacan
mrkacan / YupUserInfoSchema.js
Created May 2, 2021 06:56
Yup User Info Schema
import * as Yup from "yup";
const userInfoSchema = Yup.object().shape({
firstName: Yup.string()
.min(4, "First name should be minimum 4 character")
.required("First name is required"),
lastName: Yup.string()
.min(5, "Last name should be minimum 5 character")
.required("Last name is required"),
email: Yup.string()
@mrkacan
mrkacan / bulkTweetDeleter.js
Created August 23, 2019 11:40
Twitter bulk tweet deleter
let interval = null
let ntt = function () {
interval = setInterval(function () {
document.querySelector('[data-testid=caret]').click()
setTimeout(function () {
document.querySelector('[role=button]').click()
document.querySelector('[data-testid=confirmationSheetConfirm]').click()
}, 200)
@mrkacan
mrkacan / twitterTweetUnTweeter.js
Created August 23, 2019 10:58
Twitter auto un retweet tweets - Tweet unliker
let interval = null
let count = 10000
let ntt = function(){
interval = setInterval(function(){
document.querySelectorAll('[data-testid=unretweet]').forEach((t)=> {
t.click()
document.querySelector('[data-testid=unretweetConfirm]').click()
})
count += 1000
window.scrollTo(0, count);
@mrkacan
mrkacan / twitterTweetUnliker.js
Last active July 26, 2023 16:31
Twitter auto unlike tweets - Tweet unliker
let interval = null
let count = 10000
let ntt = function(){
interval = setInterval(function(){
document.querySelectorAll('[data-testid=unlike]').forEach((t)=> {
t.click()
})
count += 1000
window.scrollTo(0, count);
@mrkacan
mrkacan / jQueryOnHover.js
Created June 27, 2018 12:33
Jquery on hover menu
$('.dropdownLi').on('mouseenter',function () {
$(this).children('ul').slideDown(300).css('display', 'block');
$(".dropdownLi").mouseleave(function () {
$(".dropdownSection").fadeOut(300)
});
})
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
@mrkacan
mrkacan / styles.js
Last active June 4, 2018 17:52
React Native Vertical and Horizontal Center
export const styles = StyleSheet.create({
center: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});
@mrkacan
mrkacan / ajaxPostToController.js
Created April 20, 2018 07:29
C# MVC Ajax post to controller (ASP .NET MVC)
$.ajax({
cache: false,
url: "YOUR_CONTROLLER_NAME/ACTION_NAME",
data: { data: YOUR_DATA },
type: 'post',
success: () => {
//Do something for success;
},
complete: () => {
//Do something for complete;