Skip to content

Instantly share code, notes, and snippets.

View hasandz's full-sized avatar
🎯
Focusing

Hasan Dz hasandz

🎯
Focusing
View GitHub Profile
@tomschlick
tomschlick / Environments to bypass .htpasswd protection
Created November 8, 2009 08:30
This allows you to set certain urls/domains that are allowed to bypass a htpasswd protection layer, which is very useful for multiple environment setups (developement, staging, production)
#allows a single uri through the .htaccess password protection
SetEnvIf Request_URI "/testing_uri$" test_uri
#allows everything if its on a certain host
SetEnvIf HOST "^testing.yoursite.com" testing_url
SetEnvIf HOST "^yoursite.com" live_url
Order Deny,Allow
AuthName "Restricted Area"
AuthType Basic
@jakebellacera
jakebellacera / ICS.php
Last active July 10, 2024 11:27
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@mrazzari
mrazzari / readme.md
Last active October 29, 2022 00:06
WP-Migrate: standalone WP database dump into a new DB.

WP-MIGRATE

Migrates a standalone WP database dump into a new DB.

This script will take a mysqldump sql file, and:

  1. Replace the old blog's URL with the new one
  2. Replace an old WP table_prefix with a new one
  3. Take care of string lengths within serialized data

It will finally import the MySQL dump into the new DB, using wp-config's settings.

<?php
namespace Acme\Bundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
@t-io
t-io / osx_install.sh
Last active July 24, 2024 15:28
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@pippinsplugins
pippinsplugins / gist:92e53cc53649a922a10e
Created May 7, 2014 20:56
Sample custom field for EDD FES
<?php
// Begin FES integration
// add button to the post button listing
function fes_shipping_field_button( $title ) {
if ( version_compare( fes_plugin_version, '2.2', '>=' ) ) {
echo '<button class="fes-button button" data-name="edd_simple_shipping" data-type="action" title="' . $title . '">'. __( 'Shipping', 'edd-simple-shipping' ) . '</button>';
}
}
add_action('fes_custom_post_button', 'fes_shipping_field_button');
@ScreamingDev
ScreamingDev / wp-dump.php
Created December 5, 2014 10:31
wordpress db dump single php file
<?php
require_once 'wp-config.php';
$dbhost = DB_HOST;
$dbuser = DB_USER;
$dbpass = DB_PASSWORD;
$dbname = DB_NAME;
$h = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
@socieboy
socieboy / gulpfile.js
Created December 2, 2015 04:48
Gulpfile for AdminLTE and Laravel Elixier
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
@ryanscherler
ryanscherler / php-openssl.md
Last active August 16, 2018 20:06
Use Homebrew PHP with OpenSSL instead of SecureTransport