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
@icetee
icetee / acf-pagination.php
Created August 24, 2019 11:07 — forked from kisabelle/acf-pagination.php
ACF Repeater Field Pagination
<?php
/*
* Paginate Advanced Custom Field repeater
*/
if( get_query_var('page') ) {
$page = get_query_var( 'page' );
} else {
$page = 1;
}
@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 / 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 / handlebars.gravatar.js
Last active August 20, 2017 12:54 — forked from tracend/handlebars.gravatar.js
Handlebars.js - Gravatar thumbnail #handlebars #cc
// Handlebars.js - Gravatar thumbnail
// Usage: {{#gravatar email size="64"}}{{/gravatar}}
// Thanks: @tracend
import crypto from 'crypto';
import Handlebars from 'handlebars/runtime';
Handlebars.registerHelper('gravatar', (context, options) => {
const email = context;
const size = (typeof (options.hash.size) === 'undefined') ? 32 : options.hash.size;
const hash = crypto.createHash('md5').update(email).digest('hex');
@icetee
icetee / meteordeps.js
Last active May 4, 2017 01:57 — forked from aedm/meteordeps.js
This script displays dependency relations between packages required by a Meteor project
"use strict";
const execSync = require('child_process').execSync;
const fs = require('fs');
function run(command) {
return execSync(command).toString().trim();
}
console.log("Reading 'versions' file...");
@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 / rPi3-ap-setup.sh
Last active February 6, 2017 22:07 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2016 rpi jessie image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@icetee
icetee / ArraytoCSV
Last active September 28, 2015 13:08 — forked from haroonabbasi/ArraytoCSV
ArraytoCSV
<?php
/**
* Description of ArraytoCSV
*
* @author Haroon Abbasi (Thanks)
* @modified Tamás András Horváth
*
* Usage:
*
* $arrytoCSV = new ArraytoCSV();
<?php
function the_category_filter($thelist,$separator=' ') {
if(!defined('WP_ADMIN')) {
$exclude = array('A', 'B', 'C', 'D'); //as categorias para esconder
$cats = explode($separator,$thelist);
$newlist = array();
foreach($cats as $cat) {
$catname = trim(strip_tags($cat));
if(!in_array($catname,$exclude))