Skip to content

Instantly share code, notes, and snippets.

View erkanerbay's full-sized avatar
💭
I may be slow to respond.

ekotan erkanerbay

💭
I may be slow to respond.
View GitHub Profile
@erkanerbay
erkanerbay / 0_README.md
Created April 12, 2025 16:13 — forked from dhoeric/0_README.md
Google Calendar - Public Holiday Calendars
@erkanerbay
erkanerbay / jerry.swift
Created August 15, 2024 11:14 — forked from vorce/jerry.swift
Mouse move and click test thing for macos in swift
import Cocoa
import Foundation
// Move around and click automatically at random places in macos, kinda human like in a cheap way.
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at
// each point with the point as argument.
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) {
let screenSize = NSScreen.main?.visibleFrame.size
@erkanerbay
erkanerbay / nextjs-hoc-authorization.js
Created July 12, 2022 06:59 — forked from whoisryosuke/nextjs-hoc-authorization.js
ReactJS - NextJS - A HOC for wrapping NextJS pages in an authentication check. Checks for getInitialProps on the child component and runs it, so you still get SSR from the page. Also includes a user agent for Material UI.
import React, {Component} from 'react'
import Router from 'next/router'
import AuthService from './AuthService'
export default function withAuth(AuthComponent) {
const Auth = new AuthService('http://localhost')
return class Authenticated extends Component {
static async getInitialProps(ctx) {
// Ensures material-ui renders the correct css prefixes server-side
#!/bin/bash
# Compile and install (or install via Apt) FFmpeg Codecs
# Compile and install FFmpeg suite
echo "Begining Installation of FFmpeg Suite"
#Update APT Repository
echo "Updating the APT repository information"
apt-get update
@erkanerbay
erkanerbay / _document.js
Created August 11, 2021 20:57 — forked from dimitrinicolas/_document.js
Custom Next.js Document for basic html "lang" property setting according to the page path
import Document, { Head, Main, NextScript } from 'next/document';
import React from 'react';
const LANGUAGES = ['fr', 'en'];
class MyDocument extends Document {
render() {
const pathPrefix = this.props.__NEXT_DATA__.page.split('/')[1];
const lang =
@erkanerbay
erkanerbay / gist:2a31053e4046576029e06e9f9662c358
Created June 21, 2021 16:48 — forked from jamesmehorter/gist:011cfeec683d42bf69ae
Import external url/image as WordPress attachment
<?php
// Import the YouTube video thumbnail as the post's featured image
// Only proceed if there is a youtube video thumbnail
/*
Example $youtube_video_data:
array(
'id' => 'gvk6TwmF0cw',
'title' => 'Tyler Posey talks to Variety about being honored at Variety Power of Youth',
'link' => 'http://www.youtube.com/watch?v=gvk6TwmF0cw',
'thumbnail' => 'http://i.ytimg.com/vi/gvk6TwmF0cw/hqdefault.jpg',
@erkanerbay
erkanerbay / nuxt-js-and-gsheet-example.vue
Created January 29, 2021 06:54 — forked from mornir/nuxt-js-and-gsheet-example.vue
#sheets Nuxt.js vue component to display datas from a google spreadsheet (with google api V4 without oAuth )
<template>
<div id="homepage">
<h1>Les dernières Articles</h1>
<div class="article" v-for="article in articles">
<h2> {{ article.title }} </h2>
<p> {{ article.content }} </p>
</div>
</div>
</template>
@erkanerbay
erkanerbay / .profile
Created January 20, 2021 10:41 — forked from silver-xu/.profile
Adding git branch name to terminal
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@erkanerbay
erkanerbay / rm_mysql.md
Created December 29, 2020 12:30 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@erkanerbay
erkanerbay / mac-setup-redis.md
Created December 16, 2020 12:13 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis