Skip to content

Instantly share code, notes, and snippets.

@kuzeydev
kuzeydev / git-http-proto.txt
Created April 24, 2021 15:21 — forked from schacon/git-http-proto.txt
Git HTTP transport protocol documentation
HTTP transfer protocols
=======================
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
connection, and a "smart" protocol which requires a Git aware CGI
(or server module). This document describes both protocols.
As a design feature smart clients can automatically upgrade "dumb"
protocol URLs to smart URLs. This permits all users to have the
@kuzeydev
kuzeydev / .vimrc
Created December 26, 2020 17:00 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@kuzeydev
kuzeydev / 2019-https-localhost.md
Created December 21, 2020 19:36 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

# Originally published at https://gist.github.com/nzthiago/5736907
# I Customized it for SPC14 with slides
# If you like it, leave me a comment
# If you don't like it, complain to Github. :)
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
# Grab the RSS feed for the MP4 downloads
@kuzeydev
kuzeydev / git-export-changes-between-two-commits.md
Created February 1, 2020 16:31 — forked from mrkpatchaa/git-export-changes-between-two-commits.md
Git command to export only changed files between two commits

Use case : Imagine we have just created a project with composer create-project awesone-project (currently V0.2). 2 weeks later, there is a new release (V0.3). How to update your project ? Since composer update only updates the project dependencies, it is not what we are looking for. Composer doesn't know about awesome-project since it's not in our composer.json.

After trying many git solutions, I've come to this :

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2 --diff-filter=ACMRTUXB)

This command will check for changes between the two commits and ignore deleted files.

@kuzeydev
kuzeydev / regex.js
Created February 1, 2020 16:30
A List Of Helpful Regex Examples
let re;
//this looks for the string between the slashes. it'll match hello but not HeLlo.
re = /hello/;
//the lower case i means be case insensitive. this will match HellO.
re = /hello/i;
// explaination for common search characters
@kuzeydev
kuzeydev / wifi.sh
Created February 1, 2020 16:29 — forked from mrkpatchaa/wifi-password.sh
Find WIFI Password
# Windows
netsh wlan show profile NOM_DU_RESEAU_WIFI key=clear
# Mac
security find-generic-password -wa NOM_DU_RESEAU_WIFI
# Linux
sudo cat /etc/NetworkManager/system-connections/NOM_DU_RESEAU_WIFI | grep psk=
# From https://korben.info/une-commande-pour-retrouver-en-clair-le-mot-de-passe-dun-reseau-wifi.html
@kuzeydev
kuzeydev / README.md
Created February 1, 2020 16:29 — forked from mrkpatchaa/README.md
Git Detached Head

The intermediate steps of an interactive rebase are done with a detached HEAD (partially to avoid polluting the active branch’s reflog). If you finish the full rebase operation, it will update your original branch with the cumulative result of the rebase operation and reattach HEAD to the original branch. My guess is that you never fully completed the rebase process; this will leave you with a detached HEAD pointing to the commit that was most recently processed by the rebase operation.

To recover from your situation, you should create a branch that points to the commit currently pointed to by your detached HEAD:

git branch temp git checkout temp (these two commands can be abbreviated as git checkout -b temp)

This will reattach your HEAD to the new temp branch.

@kuzeydev
kuzeydev / Social Network Share Count
Created February 1, 2020 16:28 — forked from mrkpatchaa/Social Network Share Count
Getting Social Network Share Count from Facebook, Twitter, Pinterest, Linkedin, Google Plus, StumbleUpon
// Facebook Likes and Shares
$facebook_like_share_count = function ( $url ) {
$api = file_get_contents( 'http://graph.facebook.com/?id=' . $url );
$count = json_decode( $api );
return $count->shares;
};
@kuzeydev
kuzeydev / 0_reuse_code.js
Created February 1, 2020 16:28 — forked from mrkpatchaa/0_reuse_code.js
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console