Skip to content

Instantly share code, notes, and snippets.

View tuefekci's full-sized avatar

Giacomo Tüfekci tuefekci

View GitHub Profile
@tuefekci
tuefekci / php-server-with-wordpress.md
Created April 2, 2023 15:59 — forked from bainternet/php-server-with-wordpress.md
Using PHP's built in server for WordPress development.

Preface

So in the past, I've used MAMP/MAMP Pro apps and others alike. I've also, setup my own local MAMP stack with homebrew, that used dnsmasq to dynamically add vhosts anytime I added a new folder to the Sites folder which made it very convenient. But, then I started running into other environment issues with PHP versions on remote machines/servers not being updated or some other crazy thingamabob breaking. I researched and invested time in Vagrant, but that seem to break more often than my homebrew setup. So I researched again investing time into Docker via Docker for Mac (which is BAMF), which I'm sold on and use daily, but it still seems a little bleeding edge and not so simple to wrap your head around the concept. Not to mention I don't have a real use case to play with and take advantage of all the features that come packed with Docker.

This is the beginning of trying to find something more simple, and slightly quicker to setup.

@tuefekci
tuefekci / private_fork.md
Created January 8, 2023 19:33 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@tuefekci
tuefekci / windows-cmd-faq.md
Created January 7, 2023 12:48 — forked from jkonrath/windows-cmd-faq.md
Windows CMD batch file frequent issues/tips

Writing Windows CMD Batch File Stuff

I hope I never have to write another Windows .BAT file again in my life, but if I don't jot this stuff down, I will forget it, and then I will.

Subroutines

  1. Use :somelabel to define a block of code.
  2. Use call :somelabel to jump to a defined label, run that block of code to the end, then return.
  3. Use goto :label to jump to that label.
  4. Put :eof at the end of your file.
@tuefekci
tuefekci / gist:ddd83aee781fb37f531cc43b11da2168
Last active February 26, 2022 17:04 — forked from Mecanik/gist:d2314fbc860b9c68eac4b101127b738e
Install and configure PHP 7.3 ev/event PECL extension on Ubuntu Linux 18.04.3
# For phpize
apt install php7.4-dev
# Install extensions
pecl install ev
pecl install event
# Create configurations
sudo echo 'extension=ev.so' > /etc/php/7.4/mods-available/ev.ini
sudo echo 'extension=event.so' > /etc/php/7.4/mods-available/event.ini
@tuefekci
tuefekci / nav-menu-item-custom-fields.php
Created November 18, 2016 13:34 — forked from kucrut/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
@tuefekci
tuefekci / QRLogo.php
Created May 11, 2016 21:24 — forked from NTICompass/QRLogo.php
QR Code + Logo Generator
<?php
/**
* QR Code + Logo Generator
*
* http://labs.nticompassinc.com
*/
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com';
$size = isset($_GET['size']) ? $_GET['size'] : '200x200';
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE;
@tuefekci
tuefekci / php-full-depth-case-insensitive-file-exists.php
Created February 19, 2016 11:15 — forked from jrsinclair/php-full-depth-case-insensitive-file-exists.php
PHP Full-depth Case Insensitive file_exists() Function
<?php
/**
* Single level, Case Insensitive File Exists.
*
* Only searches one level deep. Based on
* https://gist.github.com/hubgit/456028
*
* @param string $file The file path to search for.
*
* @return string The path if found, FALSE otherwise.
@tuefekci
tuefekci / rsync-examples.sh
Created February 19, 2016 11:15 — forked from jrsinclair/rsync-examples.sh
Using Rsync over SSH
rsync -rlptuvhz -e ssh username@my-dev-server.dev:/path/to/dir .
# -r Recursive
# -l Copy symlinks as symlinks
# -p Copy permisisons
# -t Copy times
# -u Update. Skip files that are newer on receiving end.
# -v Verbose.
# -h Output numbers in a human-readable format
# -z Use compression when sending data over the network.
@tuefekci
tuefekci / nginx.conf
Created November 19, 2015 11:54 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
(function() {
window.frame = require("nw.gui").Window.get();
window.frame.isFocused = true;
var windowFocusHandler = function() {
window.frame.isFocused = true;
}
, windowBlurHandler = function() {
window.frame.isFocused = false;