Skip to content

Instantly share code, notes, and snippets.

View icetee's full-sized avatar
:atom:
Development

Tamás András Horváth icetee

:atom:
Development
View GitHub Profile
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);
@icetee
icetee / restart-touchbarserver.sh
Created October 26, 2020 18:46
Restart TouchBarServer
sudo pkill TouchBarServer; sudo killall ControlStrip
@icetee
icetee / realname.diff
Created March 23, 2020 14:59
Drupal realname diff
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
@icetee
icetee / Custom_HTML_Signature_in_Apple_Mail_app.md
Created February 16, 2017 16:13 — forked from yugoslavskiy/Custom_HTML_Signature_in_Apple_Mail_app.md
Custom Apple Mail HTML signature creation guide
@icetee
icetee / permissions.sh
Created September 12, 2018 16:27 — forked from heyalexej/permissions.sh
Fix WordPress File Permission
#!/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.
@icetee
icetee / Hungarian_Win.keylayout
Last active September 2, 2019 20:05
Download Windows Keyboard Layout on MacOS
sudo wget /Library/Keyboard\ Layouts/Hungarian_Win.keylayout https://raw.githubusercontent.com/zaki/mac-hun-keyboard/master/Hungarian_Win.keylayout
@icetee
icetee / Lazy Load Google Remarketing & Conversion Javascript Module.js
Last active May 18, 2019 14:35 — forked from vhsu/Lazy Load Google Remarketing & Conversion Javascript Module.js
Google Adwords Asynchronous Remarketing Javascript Module - Lazy Loading Adwords Conversion Code
// 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];
@icetee
icetee / bootstrap-grid-col-same-height.css
Created March 28, 2019 02:22
Bootstrap grid col same height
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-wrap: wrap;
}
.row > [class*='col-'] {
display: flex;
flex-direction: column;
@icetee
icetee / wp_relative_url.php
Created January 17, 2019 09:42
Use relative URL for WordPress
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);
@icetee
icetee / fix_pma_count.sh
Created January 3, 2019 06:39
Fix phpmyadmin count issue
# 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