Skip to content

Instantly share code, notes, and snippets.

@drewbaker
drewbaker / functions.php
Created January 29, 2016 18:24
Blurring image using WordPress
/**
* Several functions relatting to blurring images on uploaded.
* @see https://codeable.io/community/how-to-watermark-wordpress-images-with-imagemagick/
*/
add_image_size( 'background-image-blurred', 1920, 1080, true );
function generate_blurred_image( $meta ) {
$time = substr( $meta['file'], 0, 7); // Extract the date in form "2015/04"
$upload_dir = wp_upload_dir( $time ); // Get the "proper" upload dir
@talves
talves / wp-setup.php
Last active September 7, 2016 15:53
A Wordpress mu-plugin for use with composer using [roots](https://github.com/roots/roots) to setup the correct paths for a custom path. Modified `upload_url_path` to work on a windows IIS Server. Change to `/media` when needed.
<?php
if (!is_blog_installed()) { return; }
$my_server_port = ((!empty ($_SERVER ['SERVER_PORT']) AND $_SERVER ['SERVER_PORT'] <> '80') ? (":" . $_SERVER ['SERVER_PORT']) : '');
$my_server_name = (!empty ($my_server_port) ?($_SERVER['SERVER_NAME'] . $my_server_port) : $_SERVER['SERVER_NAME'] );
if ('http://' . $my_server_name . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $my_server_name . '/wp');
update_option('home', 'http://' . $my_server_name);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '\media');
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@zachharkey
zachharkey / README.md
Created November 28, 2012 21:28
SublimeText2 CSSTidy Custom Templates

Custom CSSTidy Templates for Sublime Text 2

The CSSTidy package for SublimeText 2 works great for toggling between different CSS formats, but none of the default options output CSS consistent with the Drupal CSS coding standards with selectors, braces and properties indented and formatted like so:

selector {
  property: value; 
}

CSSTidy allows you to add your own templates, but the documentation is sparse, then there's the matter of the Sublime Text 2 integration. If I hadn't been deeply procrastinating, I would not have had th patience to figure it all out. Here's what to do:

@pavank
pavank / Dropbox Network Drive Hack
Last active April 6, 2020 03:48
Dropbox Network Drive Hack
Follow these steps
============
1) Create a folder on local disk Eg: C:\Users\keerthip\Documents\Dropbox
2) Create a Drive Letter Mapping eg:(H:) to the folder path in windows with following command
subst H: C:\Users\keerthip\Documents\Dropbox
3) Install Dropbox desktop software in advanced Mode.
Select the new local drive H: and sync either selective folders or all folder to local drive ( which is original folder path)
4) Wait till content is fully synced from web account
5) Pause Syncing and Exit Dropbox
6) Delete local folder drive mapping with following command