Skip to content

Instantly share code, notes, and snippets.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 28, 2024 08:45
A badass list of frontend development resources I collected over time.
@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@Ulprus
Ulprus / styles.css
Last active January 10, 2024 09:57
/********** THIS SECTION INCLUDES FIXES FOR WOOCOMMERCE 8.4.0 **********/
/* Add Checkmark on ATC Button After Added */
.woocommerce #respond input#submit.added::after, .woocommerce a.button.added::after, .woocommerce button.button.added::after, .woocommerce input.button.added::after {
font-family: WooCommerce;
content: "\e017";
margin-left: 0.53em;
vertical-align: bottom;
}
<?php
/*
Plugin Name: UTF8mb4-convert
Version: 1.0
*/
function update_db_to_utf8mb4() {
if ( ! isset( $_GET['update-utf8bm4'] ) ) {
return;
}
@spivurno
spivurno / gw-gravity-forms-submission-limit.php
Last active October 23, 2023 15:33 — forked from spivurno/gist:3710653
Gravity Wiz // Gravity Forms // Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value)
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-submission-limit.php
*/
/**
* Gravity Wiz // Gravity Forms // Limit Submissions Per Time Period (by IP, User, Role, Form URL, or Field Value)
*
* Limit the number of times a form can be submitted per a specific time period. You modify this limit to apply to
@kshnurov
kshnurov / jquery.photoswipe.js
Created February 23, 2015 23:37
PhotoSwipe: init from DOM using jQuery
(function( $ ) {
$.fn.photoswipe = function(options){
var galleries = [],
_options = options;
var init = function($this){
galleries = [];
$this.each(function(i, gallery){
galleries.push({
id: i,
@spivurno
spivurno / gw-gravity-forms-map-fields-to-field.php
Last active May 22, 2023 17:27
Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
<?php
/**
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
*
* Usage
*
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
*
* Basic Fields
@yankiara
yankiara / fluid-fonts-and-icons.css
Last active July 10, 2021 04:31
Fluid fonts and icons in CSS
body {
--base: 20;
--scale-headings: 1.44;
--scale-mobile: 0.7;
--scale-mobile-headings: 0.4;
--scale-icons: 1.4;
--min-viewport: 480;
--max-viewport: 1600;
--max-size: var(--base);
}
@yankiara
yankiara / wp-defer-scripts.js
Created January 17, 2020 11:01
Defer enqueued JS scripts in Wordpress
add_filter( 'script_loader_tag', 'yankiara_defer_scripts', 10, 3 );
function yankiara_defer_scripts( $tag, $handle, $src ) {
$defer = array( 'script-handle-1', 'script-handle-2', 'script-handle-3' );
if ( in_array( $handle, $defer ) )
return '<script src="' . $src . '" defer="defer" type="text/javascript"></script>' . "\n";
return $tag;
}