created_date: 02.07.2016
last_update_date: 02.07.2016
author: @yugoslavskiy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shortcode = '[hello name="world"]'; | |
var attributes = {}; | |
shortcode.match(/[\w-]+=".+?"/g).forEach(function(attribute) { | |
attribute = attribute.match(/([\w-]+)="(.+?)"/); | |
attributes[attribute[1]] = attribute[2]; | |
}); | |
console.log(attributes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pkill TouchBarServer; sudo killall ControlStrip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/realname.api.php b/realname.api.php | |
index 09e813e..d5420bd 100644 | |
--- a/realname.api.php | |
+++ b/realname.api.php | |
@@ -53,6 +53,17 @@ function hook_realname_update($realname, $account) { | |
} | |
+/** | |
+ * Respond to updates to accounts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# | |
# configures wordpress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# script is aware of .git directories by default. edit if you need to consider | |
# other folders as well. | |
# | |
# you will find a log file in /tmp/ in case you fucked up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo wget /Library/Keyboard\ Layouts/Hungarian_Win.keylayout https://raw.githubusercontent.com/zaki/mac-hun-keyboard/master/Hungarian_Win.keylayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/icetee/2fb391954dbf16dfc81bc08ce8436f3f | |
// Usage : googremarketing.loadTag(conversionid, conversionlabel) | |
// Start Google Remarketing Module | |
var googremarketing = (function() { | |
var asyncload = 0; | |
// Load Async Google Adwords remarketing code | |
function Gremloader() { | |
if (asyncload == 0) { | |
var g = document.createElement('script'); | |
var s = document.getElementsByTagName('script')[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.row { | |
display: -webkit-box; | |
display: -webkit-flex; | |
display: -ms-flexbox; | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.row > [class*='col-'] { | |
display: flex; | |
flex-direction: column; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function callback_relative_url($buffer) { | |
// Replace normal URLs | |
$home_url = esc_url(home_url('/')); | |
$home_url_relative = wp_make_link_relative($home_url); | |
// Replace URLs in inline scripts | |
$home_url_escaped = str_replace('/', '\/', $home_url); | |
$home_url_escaped_relative = str_replace('/', '\/', $home_url_relative); | |
$buffer = str_replace($home_url, $home_url_relative, $buffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Warning in ./libraries/sql.lib.php#613 | |
# count(): Parameter must be an array or an object that implements Countable | |
# https://stackoverflow.com/a/50536059/6393270 | |
sudo sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php |