Skip to content

Instantly share code, notes, and snippets.

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

Ozan Mora ozanmora

🏠
Working from home
View GitHub Profile
@ozanmora
ozanmora / LoginController.php
Created November 6, 2023 06:09 — forked from lucahate/LoginController.php
Migrate users password from MD5 Hash system to Laravel 5.5 Hash system without ask users to change it
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use App\User;
use Hash;
@ozanmora
ozanmora / MultipleSSHGitAccounts.md
Created August 5, 2023 13:27 — forked from juandm/MultipleSSHGitAccounts.md
Set up multiple git accounts (Gitlab, Github, Bitbucket) with SSH in the same machine

Multiple GIT accounts setup

This short tutorial shows how to set up multiple different accounts of many git repository sites using SSH, all this tutorial and its commands were aplied in Ubuntu.

Generate SSH keys

Generate SSH keys for each one of the sites you wanna connect:

  1. Open your terminal and type the following command to generate a RSA key:

ssh-keygen -o -t rsa -b 4096 -C "email@example.com"

@ozanmora
ozanmora / raspberry-pi-cec-client.md
Created August 2, 2023 10:16 — forked from rmtsrc/raspberry-pi-cec-client.md
Using cec-client on a Raspberry Pi to control TV power and inputs via HDMI

Using cec-client on a Raspberry Pi

Most modern HDMI connected devices support Consumer Electronics Control (CEC). It allows devices to send commands to each other, typically to get the TV to switch input and control volume. If you have ever turned on a Game Console and had your TV automatically change input to that device you have seen CEC in action. It is very convenient and useful, sort of a universal remote that works.

Every manufacturer seems to have it’s own branding of CEC (e.g. Samsung Anynet+, LG SimpLink, Sharp Aquos Link) but it may need to be enabled. Check your manual for details.

Using a Raspberry Pi connected to a TV that supports CEC, you can use the command line cec-client application to control the inputs and the TV itself. These are notes on how to use cec-client and understand the different options.

Details

@ozanmora
ozanmora / sphp.sh
Created February 10, 2022 08:45 — forked from rhukster/sphp.sh
Easy Brew PHP version switching
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
homebrew_path=$(brew --prefix)
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ozanmora
ozanmora / .ubuntu.md
Last active April 6, 2022 07:29
Ubuntu, after installation settings & applications.

Ubuntu, after installation settings & applications.

@ozanmora
ozanmora / .js.md
Last active September 20, 2022 08:57
Some useful JavaScript codes.

Some useful JavaScript codes.

@ozanmora
ozanmora / .codeigniter3.md
Last active January 26, 2022 07:38
Some useful Codeigniter 3.x files.

Some useful Codeigniter 3.x files.

@ozanmora
ozanmora / CI_phpStorm.php
Created January 24, 2020 07:03 — forked from topdown/CI_phpStorm.php
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
@ozanmora
ozanmora / .macos.md
Last active May 8, 2023 02:18
MacOS Clean Install Settings & Applications

MacOS Clean Install Settings & Applications

Homebrew, applications, web server, oh my zsh and more..