Skip to content

Instantly share code, notes, and snippets.

View jrtashjian's full-sized avatar
🪓
Axe-ceptional at axing code

JR Tashjian jrtashjian

🪓
Axe-ceptional at axing code
View GitHub Profile
@jrtashjian
jrtashjian / pixelate.js
Created April 30, 2022 01:55
Pixelated images in JS with Canvas
function pixelate( event ) {
// Set pixel size.
const pixelSize = 16;
// Get original image dimensions.
const element = event.target;
const originalImageWidth = parseInt( element.getAttribute( 'width' ) );
const originalImageHeight = parseInt( element.getAttribute( 'height' ) );
// Create a canvas for rendering pixelated image.
@jrtashjian
jrtashjian / pve-nag-buster.sh
Last active December 18, 2021 20:35
Disable Proxmox license nag.
#!/bin/sh
NAGTOKEN="data.status.toLowerCase() !== 'active'"
NAGFILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
SCRIPT="$(basename "$0")"
# Disable license nag
if grep -qs "$NAGTOKEN" "$NAGFILE" > /dev/null 2>&1; then
echo "$SCRIPT: Removing PVE Nag..."
registerBlockVariation( 'core/embed', {
name: 'gist',
title: 'Gist',
patterns: [ /https?:\/\/gist\.github\.com.+/i ],
attributes: { providerNameSlug: 'gist' },
isActive: () => [ 'providerNameSlug' ],
} );

Keybase proof

I hereby claim:

  • I am jrtashjian on github.
  • I am jrtashjian (https://keybase.io/jrtashjian) on keybase.
  • I have a public key ASD3sj3gc-e2q-Zc83eigjc8OhJboImQ2Eejxj-tsu58aAo

To claim this, I am signing this object:

@jrtashjian
jrtashjian / .env
Last active March 10, 2020 05:33
OAuth2 ESI Client
EVEONLINE_KEY=**your application key**
EVEONLINE_SECRET=**your application secret**
EVEONLINE_REDIRECT_URI=http://yourapp.tld/auth/eve/callback/
<?php
wp_register_script(
'gwg-block',
GWG_ESNEXT_PLUGIN_URL . 'block.build.js',
[ 'wp-blocks', 'wp-i18n', 'wp-data', 'wp-compose' ],
GWG_ESNEXT_VERSION,
true // Enqueue script in the footer.
);
@jrtashjian
jrtashjian / .browserlistrc
Created April 11, 2019 19:25
Get With Gutenberg - Getting Started with Block Development in ES.Next • https://getwithgutenberg.com/2019/03/getting-started-with-block-development-in-es-next/
> 1%
ie >= 11
last 1 Android versions
last 1 ChromeAndroid versions
last 2 Chrome versions
last 2 Firefox versions
last 2 Safari versions
last 2 iOS versions
last 2 Edge versions
last 2 Opera versions
<?php
/**
* Add a block category for "Get With Gutenberg" if it doesn't exist already.
*
* @param array $categories Array of block categories.
*
* @return array
*/
function gwg_block_categories( $categories ) {
$category_slugs = wp_list_pluck( $categories, 'slug' );
@jrtashjian
jrtashjian / 01.php
Last active April 11, 2019 18:43
Get With Gutenberg - How to Internationalize Your Block • https://getwithgutenberg.com/2019/04/how-to-internationalize-your-block/
<?php
function gwg_register_block_type() {
if ( ! function_exists( 'register_block_type' ) ) {
// Gutenberg is not active.
return;
}
wp_register_style(
'gwg-style',
@jrtashjian
jrtashjian / readme.txt
Created February 22, 2019 20:39
CurateWP Readme
=== CurateWP ===
Contributors: jrtashjian
Tags: curatewp, curation, block, widget, shortcode,
Requires at least: 4.9.8
Tested up to: 5.1
Requires PHP: 5.2.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html