Skip to content

Instantly share code, notes, and snippets.

@kneipp
kneipp / gist:525043c627f433cb1f9e
Created August 28, 2014 13:21
adding custom style to wp-admin wordpress
<?php
//http://wordpress.stackexchange.com/questions/110895/adding-custom-stylesheet-to-wp-admin
//from functions.php
//First solution : one file
add_action( 'admin_enqueue_scripts', 'load_admin_style' );
function load_admin_style() {
wp_register_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
//OR
wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0' );
@kneipp
kneipp / gist:de9c0876242fc0ff849c
Created September 7, 2014 23:30
ao instalar o mysql
mysql_secure_installation
@kneipp
kneipp / gist:ee44c864d44f3e5258e9
Created September 8, 2014 13:40
403 Forbidden after install PHP56 and Apache OSX Ubuntu
Checklist:
- Check if your user exists in: /private/etc/apache2/users
- Check if your path is correct inside conf file:
<Directory "/Users/username/Projects">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
@kneipp
kneipp / gist:288abd866b593f9592f0
Created September 12, 2014 19:52
httpd.conf - htaccess settings
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
@kneipp
kneipp / gist:431094e9a8f8fb9a2054
Created February 7, 2015 16:32
php_codesniffer osx
pear uninstall PHP_CodeSniffer
pear config-set php_bin change/path/to
pear config-set bin_dir change/path/to
pear install PHP_CodeSniffer
@kneipp
kneipp / .htaccess
Created May 8, 2015 02:21
htaccess removing php extension keeping query string
# http://stackoverflow.com/questions/19050516/combine-htaccess-rules-remove-extension-and-rewrite-url-variables?rq=1
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine On
RewriteBase /subdirectory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@kneipp
kneipp / gist:361093f3104841b8110b
Created May 18, 2015 15:31
homebrew update bugfix after long time w/o signin on computer
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
npm config set registry "http://registry.npmjs.org/"
@kneipp
kneipp / testing empty() and __get() behavior
Created September 30, 2015 14:48
php 5.6.13 - testing empty and __get() behavior
<?php
class Xpto
{
protected $a = 'a';
public $b = 'b';
public function __get($key)
{
echo '__get() ';
@kneipp
kneipp / gist:4c56ba70c416fb187a55
Created October 24, 2015 19:57
command line tools - download link
https://developer.apple.com/downloads/?=command%20line%20tools