Skip to content

Instantly share code, notes, and snippets.

@Log1x
Log1x / Win10.preset
Created February 8, 2020 21:54
Recommended Windows 10 Performance Preset
# See: https://github.com/Disassembler0/Win10-Initial-Setup-Script
### Require administrator privileges ###
RequireAdmin
### Privacy Tweaks ###
DisableTelemetry # EnableTelemetry
DisableWiFiSense # EnableWiFiSense
DisableSmartScreen # EnableSmartScreen
DisableWebSearch # EnableWebSearch
@freddielore
freddielore / public-defer-javascript.html
Created June 28, 2019 02:46
[Defer Third Party Scripts] Defer third party scripts #javascript #html #public
<script type="text/javascript">
var app = {
init: function() {
window.addEventListener('scroll', function() {
if (window.__he == undefined) {
app.load();
}
});
window.addEventListener('mousemove', function() {
@Log1x
Log1x / functions.php
Created March 7, 2019 16:38
Remove noopener & noreferrer on WordPress links
/**
* Remove rel="noopener noreferrer" in TinyMCE links
*
* @param array $init
* @return array
*/
add_filter('tiny_mce_before_init', function ($init) {
$init['allow_unsafe_link_target'] = true;
return $init;
});
@niraj-shah
niraj-shah / sequential.js
Created October 8, 2018 16:18
Sequential Ajax Calls using jQuery
// parameters for ajax calls
var items = [
{ 'gender': 'male', 'nat': 'US' },
{ 'gender': 'female', 'nat': 'GB' }
];
// function to trigger the ajax call
var ajax_request = function(item) {
var deferred = $.Deferred();
@mahdiyazdani
mahdiyazdani / get-dynamic-sidebar.php
Created February 1, 2018 13:12
Since there is NO "get_dynamic_sidebar" in the core, to return sidebar content instead of echoing out use the method below.
<?php
/**
* Gets the sidebar content based on given sidebar ID.
*
* @link https://forums.envato.com/t/get-dynamic-sidebar/76169/3?u=mypreview
* @param string $id ID of required registered sidebar.
* @return string|html The content of sidebar returned with HTML markup without "echo".
*/
if ( ! function_exists( 'prefix_get_dynamic_sidebar' ) ) :
@riodw
riodw / deploy.php
Last active May 8, 2023 08:54
Deploy to Production Server with git using PHP
<?php
/**
* GIT DEPLOYMENT SCRIPT
*
*/
// The commands
$commands = array(
'echo $PWD',
'whoami',
'git reset --hard HEAD',
@lukecav
lukecav / DNS Prefetch domains
Last active October 9, 2024 00:30
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@amboutwe
amboutwe / yoast_seo_opengraph_change_image_size.php
Last active October 28, 2024 06:15
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
anonymous
anonymous / config.json
Created September 30, 2015 14:27
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",