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 / dotNetMvcIOSClickRenderProblem.js
Created April 20, 2018 07:15
C# MVC Iphone click button render problem solved (.NET MVC)
function onClickBuyButton() {
function reClick(){
let asd = setTimeout(function () {
$('.buyButton').click();
lock = false;
}, 200);
return true;
}
if ($('#termsofservice').is(':checked')) {
if (!lock) {
@mrkacan
mrkacan / escapeShortcustListener.js
Created April 20, 2018 07:24
Javascript escape shortcuts listener
window.addEventListener('keydown', (keyboardEvent) => {
if ((keyboardEvent.key === "Escape" || keyboardEvent.key === "Esc")) {
//Do something...
}
});
@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;
@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'
}
});
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
@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)
});
})
@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 / 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 / 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 / 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()