Skip to content

Instantly share code, notes, and snippets.

View quadmachine's full-sized avatar

Mladen Panic quadmachine

View GitHub Profile
@quadmachine
quadmachine / private.xml
Created July 31, 2015 12:49
Custom mappings for Karabiner.app
<?xml version="1.0"?>
<root>
<item>
<name>§ to ` for internal keyboard</name>
<identifier>private.swap_space_and_tab</identifier>
<autogen>__KeyToKey__ KeyCode::RawValue::0xa, KeyCode::RawValue::0x32</autogen>
</item>
</root>
@quadmachine
quadmachine / share.js
Created June 2, 2014 15:08
Quick 'n' dirty sharing popup
/*
* Set proper href on you share links and add social-link class
*
* Facebook - https://www.facebook.com/sharer/sharer.php?u=cdr-capital.dev
* Twitter - http://twitter.com/?status=http%3A%2F%2Fcdr-capital.dev
*
*/
function popwindow(e){
e.preventDefault();
/* Lets not rely on paths in the database, they can be very wrong when moving between dev/stage/live environments */
/* The following two variables are backward to my thinking, but hey, what ya gonna do? */
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . ''); // This is NOT the 'wordpress admin area' home, but the site's home
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/SECRETDIRECTORY'); // This isn't the site's URL but the WordPress admin area URL
/* MySQL settings */
switch($_SERVER['SERVER_NAME']){
// Your local machine's settings
case 'mysite.local':
define('DB_NAME', 'dev_mysite');
@quadmachine
quadmachine / .gitignore
Last active August 29, 2015 14:00 — forked from redoPop/.gitignore
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
#!/bin/sh
#Script for weekly cleanup of large log files and sleep images
#Place in /private/etc/periodic/weekly to run weekly
rm /Applications/MAMP/logs/php_error.log
echo PASS | sudo rm -rf /var/vm/sleepimage
@quadmachine
quadmachine / 999.music.sh
Last active August 29, 2015 13:57
Script for daily backup of music folder and music library
#!/bin/sh
#Script for daily backup of music folder and music library
#Place in /private/etc/periodic/daily to run daily
rsync -avz --delete /Users/Mladen/Music/ /Volumes/Prostor/Music/ --log-file=/Users/Mladen/.user_logs/.music.log
function wpr_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Please come back soon &hearts;');
}
}
add_action('get_header', 'wpr_maintenance_mode');
{
"auto_complete_commit_on_tab": false,
"auto_match_enabled": true,
"bold_folder_labels": true,
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Tomorrow-Night-Eighties.tmTheme",
"detect_indentation": false,
"draw_white_space": "all",
"flatland_square_tabs": true,
"font_face": "Menlo",
@quadmachine
quadmachine / gist:8843335
Last active August 29, 2015 13:56
ProcessWire template dev .gitignore
#OSX specific
.DS_Store
.AppleDouble
.LSOverride
._*
.Spotlight-V100
.Trashes
#PW specific
*.old