Skip to content

Instantly share code, notes, and snippets.

View rawsta's full-sized avatar
:shipit:

rawsta rawsta

:shipit:
View GitHub Profile
@w3collective
w3collective / save-data-localstorage.html
Created May 31, 2021 01:10
Save data in localStorage using JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Save data in localStorage using JavaScript</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<form id="note-form">
@rosswintle
rosswintle / spam-pixel.php
Created March 26, 2021 10:23
WordPress Spam Pixel code for WP Forms
<?php
/**
* Plugin Name: Spam Pixel
* Description: This simple plugin integrates Ross's spam pixel idea with WP Forms
* Author: Ross Wintle
* Author URI: https://rosswintle.uk
* Text Domain: spam-pixel
* Domain Path: /languages
* Version: 0.1.0
*
<?php
/**
* Plugin With Checks Bootstrap
*
* @package Plugin With Checks
* @subpackage Core
* @copyright Copyright (c) 2021, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
@ricealexander
ricealexander / emoji-list.md
Last active July 19, 2024 03:20 — forked from rxaviers/gist:7360908
Comprehensive list of GitHub-supported emojis
@WebReflection
WebReflection / custom-elements-pattern.md
Last active May 17, 2024 23:30
Handy Custom Elements' Patterns

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.

@XianYeeXing
XianYeeXing / svgToPng.js
Last active May 16, 2024 15:45
Convert SVG (data url) into PNG (data url) and scale it to the desired size.
/*
EXAMPLE
=======
svgToPng(
'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgaGVpZ2h0PSczMDBweCcgd2lkdGg9JzMwMHB4JyAgZmlsbD0iIzAwMDAwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCA1LjU1NiAxMDAgODguODg5IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgNS41NTYgMTAwIDg4Ljg4OSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGc+PHBhdGggZD0iTTkwLDE2LjY2N1Y1LjU1Nkg1NS41NTZ2MTEuMTExSDQ0LjQ0NFY1LjU1NkgxMHYxMS4xMTFINy42NDFIMFY1MGg3LjY0MUgxMHYxMi4yMjNoMTEuMTExdjEwaDExLjExMXYxMi4yMjJoMTEuMTExdjEwDQoJCWgxMy4zMzN2LTEwaDExLjExVjcyLjIyM2gwLjk5NGgxMC4xMTd2LTEwSDkwVjUwaDIuMjgzSDEwMFYxNi42NjcgTTI0LjQ0NCwyOS4wMTZ2MTIuMDk2SDExLjExMVYyOS4wMTZWMTcuNzc4aDEzLjMzM1YyOS4wMTZ6Ij48L3BhdGg+PC9nPjwvc3ZnPg==',
65,
65
)
.then(console.log);
@goldie-lin
goldie-lin / neovim-install-providers-in-windows.md
Last active December 26, 2023 16:55
Install provider-* for Neovim (nvim) in Windows

Install provider-* for Neovim (nvim) in Windows

:h provider-python

First, add those lines in your %LocalAppData%\nvim\init.vim:

" Source local init.vim {{{1
let s:local_vimrc = expand('$LOCALAPPDATA\nvim\init.local.vim')
if filereadable(fnameescape(s:local_vimrc))
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 27, 2024 13:54
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@gareth-gillman
gareth-gillman / functions.php
Created March 8, 2018 17:46
WordPress Preconnect Google Fonts
function gg_gfonts_prefetch() {
echo '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>';
echo '<link rel="preconnect" href="https://fonts.googleapis.com/" crossorigin>';
}
add_action( 'wp_head', 'gg_gfonts_prefetch' );
@lukecav
lukecav / .htaccess
Last active June 26, 2024 00:24
Apache - Browser caching and mod_deflate for WordPress
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/schema+json
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf