Skip to content

Instantly share code, notes, and snippets.

View ridvanaltun's full-sized avatar
🐴
prostagma?

Rıdvan Altun ridvanaltun

🐴
prostagma?
View GitHub Profile

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@ridvanaltun
ridvanaltun / remove-file-git-history.md
Last active August 5, 2021 22:59
Remove chunks from git history

Why?

  • Removing Crazy Big Files
  • Removing Passwords, Credentials & other Private data

Detect Large Files on Git History

Note: numfmt is not available on macOS, install with brew install coreutils command before proceed.

Regex List

// Phone Number
function mobilePhoneRegEx(val) {
    return /^(05)([0-9]{2})\s?([0-9]{3})\s?([0-9]{2})\s?([0-9]{2})$/.test(val);
    /*
    05231231212
    0523 123 12 12
    */
@ridvanaltun
ridvanaltun / bitbucket-pipelines.yml
Created August 13, 2021 20:55
Dispatch GitHub Action From Bitbucket
# Template NodeJS build
# This template allows you to validate your NodeJS code.
# The workflow allows running tests and code linting on the default branch.
image: node:10.15.3
pipelines:
branches:
main:
@ridvanaltun
ridvanaltun / store-files-in-secrets.md
Last active August 14, 2021 06:23
Store Files in Secrets
@ridvanaltun
ridvanaltun / README.md
Last active August 14, 2021 19:42
Extract Android App versionCode and versionName from bundle (aab) file
# dump manifest file in xml
bundletool dump manifest --bundle bundle.aab

# extract just the versionCode from aab
bundletool dump manifest --bundle bundle.aab --xpath /manifest/@android:versionCode

Download for macOS: brew install bundletool

@ridvanaltun
ridvanaltun / docker-compose.yaml
Last active August 14, 2021 19:40
OpenCart Docker Compose
version: '2'
services:
mariadb:
image: docker.io/bitnami/mariadb:10.3
container_name: opencart-db
volumes:
- 'mariadb_data:/bitnami/mariadb'
env_file:
- production.env
phpmyadmin:
@ridvanaltun
ridvanaltun / db-connect-test.md
Created August 14, 2021 20:34
DB test in PHP

before start

  • open your php.ini file
  • remove semicolon from ;extension=mysqli like extension=mysqli

code

<?php
# Fill our vars and run on cli
@ridvanaltun
ridvanaltun / random-git-message.md
Last active August 25, 2021 19:23
Random Git Message from whatthecommit.com
# tested on linux and macOS
echo $(wget whatthecommit.com -q -O -) | tr -d '\n' | sed -e 's/.*<p>\(.*\)<\/p>.*/\1/' | awk '{split($0,a,"</p>"); print a[1]}'
@ridvanaltun
ridvanaltun / App.js
Last active August 25, 2021 19:26
Error Boundaries in React Native
import React, {Component} from 'react';
import {Text, View} from 'react-native';
import CounterApp from '../Components/CounterApp';
import ErrorBoundries from '../Components/ErrorBoundries';
export default class AppContainer extends Component {
render() {
return (
<>
<Text style={{alignSelf: 'center', marginTop: 20}}>Counter App</Text>