Skip to content

Instantly share code, notes, and snippets.

View semihkeskindev's full-sized avatar
🎉

Semih keskin semihkeskindev

🎉
View GitHub Profile
@semihkeskindev
semihkeskindev / mysqldump_docker_remote.sh
Created December 1, 2021 11:01
mysql export database from docker container to local
# https://newbedev.com/exporting-data-from-mysql-docker-container
# delete first line from dump.sql file
docker-compose exec db mysqldump -u root -proot wordpress > dump.sql
@halillusion
halillusion / Turkish Character Uppercase-Lowercase Function.php
Created July 27, 2018 08:13
Türkçe karakter dönüşümü yapabileceğiniz PHP fonksiyon
<?php
function case_converter( $keyword, $transform='lowercase' ){
$low = array('a','b','c','ç','d','e','f','g','ğ','h','ı','i','j','k','l','m','n','o','ö','p','r','s','ş','t','u','ü','v','y','z','q','w','x');
$upp = array('A','B','C','Ç','D','E','F','G','Ğ','H','I','İ','J','K','L','M','N','O','Ö','P','R','S','Ş','T','U','Ü','V','Y','Z','Q','W','X');
if( $transform=='uppercase' OR $transform=='u' )
{
$keyword = str_replace( $low, $upp, $keyword );
@widdowquinn
widdowquinn / kali_osx_persistence_wifi.md
Last active November 16, 2024 00:55
Kali Linux Live USB with persistence and wireless on Macbook Pro

Kali Linux Bootable USB with Persistence and Wireless on OSX

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP. I downloaded the amd64 weekly version, as the pool linux headers (needed below for installation of wireless drivers) were ahead of the stable release kernel.

Download the SHA256SUMS and SHA256SUMS.gpg files from the same location.

@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active November 14, 2024 01:45
npm vs yarn command translation cheat sheet
@simonhamp
simonhamp / AppServiceProvider.php
Last active January 25, 2025 03:20
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@roldershaw
roldershaw / imsg
Last active January 5, 2025 10:33
Send iMessages from the command line using Bash and AppleScript
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: imsg [address] [message]"
else
/usr/bin/osascript -e 'tell application "Messages"
send "'"$2"'" to buddy "'"$1"'" of service "E:[email protected]"
end tell'
echo "Sent"
fi
@SeanCannon
SeanCannon / array_flatten.php
Last active October 28, 2024 18:01
PHP array_flatten() function. Convert a multi-dimensional array into a single-dimensional array.
<?php
/**
* Convert a multi-dimensional array into a single-dimensional array.
* @author Sean Cannon, LitmusBox.com | [email protected]
* @param array $array The multi-dimensional array.
* @return array
*/
function array_flatten($array) {
if (!is_array($array)) {
@rakeshtembhurne
rakeshtembhurne / import_export_gz.sql
Created July 15, 2013 08:40
MySQL: Import and export in gzip form
// Export database in gzip form
mysqldump -u user -p database | gzip > database.sql.gz
// Import database from gzip form
gunzip < database.sql.gz | mysql -u user -p database
@excalq
excalq / gist:2961415
Last active January 21, 2025 22:43
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// 2024 Update, use URLSearchParams [https://caniuse.com/urlsearchparams]
export function createQueryString2(name: string, value: string, searchParams: any) {
const params = new URLSearchParams(searchParams);
params.set(name, value.toLowerCase());
return params.toString();
}
// ---- Original 2012 version, when browsers really sucked ----
// Explicitly save/update a url parameter using HTML5's replaceState().
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"