Skip to content

Instantly share code, notes, and snippets.

View rniswonger's full-sized avatar
🖖

Ryan Niswonger rniswonger

🖖
View GitHub Profile
@maxov
maxov / README.md
Last active August 29, 2015 13:57
An explanation of how to share variables between Gulp and Grunt

Sharing variables between Gulp and Grunt

Gulp, while being a great build system, isn't perfect. Its plugin system is immature and not as full-featured as Grunt. I created gulp-grunt as a remedy for this problem, making it possible to import tasks from Grunt to gulp.

However, sometimes you want to use variables in both files. How? Well, use an accessory file to define all your variables, and import it from both.

@TeddyGandon
TeddyGandon / _bga_ide_helper.php
Last active July 7, 2020 00:43
This an IDE helper for developing games on Board Game Arena Studio. Feel free to use it in your preferred IDE to get out these ugly undefined methods errors and to have a direct documentation to classes / methods.
<?php
/**
* This an IDE helper for developing games on Board Game Arena Studio.
* Feel free to use it in your preferred IDE to get out these ugly undefined methods errors and to have a direct
* documentation to classes / methods.
*
* @author Teddy Gandon
* @see https://gist.github.com/TeddyGandon/9e3183475252203b1ede192688b463cd
*/
@retlehs
retlehs / header.php
Created April 29, 2015 04:55
Sage header template for Bootstrap top navbar component
<?php
// This file assumes that you have included the nav walker from https://github.com/twittem/wp-bootstrap-navwalker
// somewhere in your theme.
?>
<header class="banner navbar navbar-default navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only"><?= __('Toggle navigation', 'sage'); ?></span>
@maban
maban / Maban Website Contract.md
Last active September 22, 2021 06:49 — forked from malarkey/Contract Killer 3.md
My boilerplate contract

Website Contract [month] [year]

Description of this Contract

This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.

In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].

By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].

@rmpel
rmpel / wp-499-up-fix-csv-upload.php
Last active January 2, 2022 15:01
A filter (an mu-plugin) to restore CSV upload functionality to WordPress 4.9.9 and up.
<?php
/**
* Restore CSV upload functionality for WordPress 4.9.9 and up
*/
add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) {
if ( extension_loaded( 'fileinfo' ) ) {
// with the php-extension, a CSV file is issues type text/plain so we fix that back to
// text/csv by trusting the file extension.
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$real_mime = finfo_file( $finfo, $file );
@bitfade
bitfade / gist:4555047
Last active January 21, 2022 03:06
WordPress - Remove empty p tags for custom shortcodes
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
@plasticmind
plasticmind / functions.php
Last active July 14, 2022 09:41
Adding column count class to Gutenberg columns block
<?php
/**
* inject_class_column_count
*
* @param string $content The block content about to be appended.
* @param array $block The full block, including name and attributes
* @return $content;
*/
function inject_class_column_count( $content, $block ) {
if ( ! is_block_type( $block, "core/columns" ) ) {
@alanedwardes
alanedwardes / rays.js
Created December 24, 2011 20:53
Generates animated sun rays using HTML canvas
var rays = new Object({
canvas: false,
context: false,
interval: false,
offset: 0,
init: function(id, colour1, colour2){
this.canvas = document.getElementById(id);
this.context = this.canvas.getContext('2d');
this.canvas.style.background = colour1;
this.context.fillStyle = colour2;
@psebborn
psebborn / countCSSRules.js
Last active April 25, 2023 11:43
Count the number of rules and selectors for CSS files on the page. Flags up the >4096 threshold that confuses IE
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@rniswonger
rniswonger / bookmarklet-fix-gmail-desktop-annoyances.js
Last active August 24, 2023 16:47
A bookmarklet that resizes image and table content in Gmail messages to prevent horizontal scrolling.
javascript: (() => { let style = document.createElement("style"); style.innerHTML = ` .a3s table { width: 90% !important; } .a3s img { max-width: 90% !important; height: auto !important; } tr:has(.ast) { display: none !important; } `; document.head.appendChild(style);})();