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 / win10_normalizer.ps1
Last active October 25, 2023 04:41
Windows 10 remove unnecessary applications
#Uninstall 3D Builder
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
#Uninstall Alarms and Clock
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
#Uninstall Calculator
Get-AppxPackage *windowscalculator* | Remove-AppxPackage
#Uninstall Calendar and Mail:
@icetee
icetee / wp_ext_pll_functions.php
Last active March 20, 2023 12:54
Polylang function_exists (active the plugin) - WordPress - Paste the code into functions.php
/*
* Polylang Language API functions tester - WordPress
* Github: https://gist.github.com/icetee/fbbfef5534fead58611e
*
*/
function ex_pll_the_languages($arg = '') {
if ( function_exists('pll_the_languages') ) {
return pll_the_languages($arg);
}
@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 / ftpconfigs.sh
Last active March 17, 2022 09:11
Save all .ftpconfig in the folder.
# macOS
find . -maxdepth 5 -iname ".ftpconfig" | zip DEV.zip -@
# Windows 10
Get-ChildItem -Recurse -Depth 5 -Filter ".ftpconfig" -Path . | % { $_.FullName } | zip DEV.zip -@
@icetee
icetee / wanip
Created February 8, 2016 22:43
wanip
alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'
@icetee
icetee / .my.cnf
Last active March 17, 2022 06:19
Backup for MySQL with mysqldump (all database)
[mysql]
user=backups
password=secret
[mysqldump]
user=backups
password=secret
@icetee
icetee / serial_number_generator.js
Created October 14, 2021 14:33
Get random serial numbers
let count = 10100;
let prefix = "KGY"
let keys = [];
let getRandomNumber = () => ("0000" + Math.round(Math.random() * 10000)).slice(-4)
do {
let randomKey = prefix + "-" + getRandomNumber() + "-" + getRandomNumber();
if (keys.indexOf(randomKey) === -1) {
@icetee
icetee / filtered_contact_type.patch
Last active June 26, 2021 20:34
Hotfix for CiviCRM contact_type Organization filter and disable "factory" contact
--- web/app/plugins/civicrm/civicrm/CRM/Profile/Selector/Listings.php
+++ Listings.php
@@ -451,6 +451,8 @@
$additionalWhereClause = 'contact_a.is_deleted = 0';
+ $extraWhereClause = 'contact_a.contact_type = "Organization" AND contact_a.id != 1';
+
if ($extraWhereClause) {
$additionalWhereClause .= " AND {$extraWhereClause}";
@icetee
icetee / mailtrain_scrapper.js
Created April 20, 2021 09:39
MailTrain export scrapper script
var rows = [];
$('tbody tr').each((i, elem) => {
var $elem = $(elem),
$td = $(elem).find('td');
var row = [];
row.push($td[0].innerText);
row.push($td[1].innerText);
row.push($td[2].innerText);
@icetee
icetee / customize_add_hover.php
Last active January 25, 2021 00:42
WordPress Customize - Add hover logo
// Use:
// get_theme_mod('theme_hover_logo');
function theme_customizer_setting($wp_customize) {
$wp_customize->add_setting('theme_hover_logo');
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'theme_hover_logo', [
'label' => 'Upload Hover Logo',
'section' => 'title_tagline',
'settings' => 'theme_hover_logo',
'priority' => 8,