Skip to content

Instantly share code, notes, and snippets.

@devwax
devwax / wordpress_snippets.php
Last active March 30, 2023 18:59
WordPress Snippets
<?php
// Frontend memory limit
define('WP_MEMORY_LIMIT', '64M'); // Default for WooCommerce: https://github.com/WordPress/WordPress/blob/master/wp-includes/default-constants.php#L50
// /wp-admin/ memory limit
define('WP_MAX_MEMORY_LIMIT', '256M'); // Default: https://github.com/WordPress/WordPress/blob/master/wp-includes/default-constants.php#L62
// WordPress memory limits deep dive: https://www.saotn.org/increase-wordpress-memory-limit-wp-config-php/
anonymous
anonymous / webpack.config.js
Created March 31, 2017 07:32
const webpack = require('webpack')
const fs = require('fs')
// NODE_ENV
const nodeEnv = process.env.NODE_ENV || 'development'
const isProd = nodeEnv === 'production'
module.exports = (options) => {
let entryFile, outputPath, isClient, isServer
@lopspower
lopspower / README.md
Last active July 23, 2024 13:00
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

<?php
add_action( 'wp_head', 'custom_genesis_page_builder_styles' );
/**
* Echo the necessary "Full Page Width" styles into the head of the page.
* Credit for the following CSS goes to the developer of the "Genesis Dambuster"
* Plugin as this CSS is an edited version of that Plugin's full-width.css file.
*/
function custom_genesis_page_builder_styles() {
echo '
<style type="text/css">
@RubyTuesdayDONO
RubyTuesdayDONO / gist:5006455
Last active May 15, 2024 22:22 — forked from six8/gist:1732686
logic revisions to pass test case
// Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f
function resolve(graph) {
var sorted = [], // sorted list of IDs ( returned value )
visited = {}; // hash: id of already visited node => true
// 2. topological sort
Object.keys(graph).forEach(function visit(name, ancestors) {
if (!Array.isArray(ancestors)) ancestors = [];
ancestors.push(name);
visited[name] = true;
@shinout
shinout / LICENSE
Created September 21, 2011 16:15
Topological sort in JavaScript
Copyright 2012 Shin Suzuki<shinout310@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,