Skip to content

Instantly share code, notes, and snippets.

View nikolailehbrink's full-sized avatar
👋

Nikolai Lehbrink nikolailehbrink

👋
View GitHub Profile
@lambdaxyzt
lambdaxyzt / image.jsx
Last active April 8, 2025 21:37
Remix Image Component ( use cache 'cacashe library' , stream base , sharp library )
// resource route component
import React from "react";
import { PassThrough } from "node:stream"
import fs from "node:fs"
import {createReadableStreamFromReadable} from "@remix-run/node"
import { defaultQuality,widths,mainImageReadStream,generatedImageReadstream, isThereImage,BadImageResponse } from "../../util/image.server"
export const loader = async ({ request }) => {
const url = new URL(request.url);
const src = url.searchParams.get("src");
@awsm-support
awsm-support / job-functions.php
Created August 30, 2021 09:58
WP Job Openings - Reset Job Views Count
<?php
/**
* NOTE: Please execute this function only once. After resetting the views, remove the whole code snippet.
*/
function awsm_jobs_reset_views_count() {
$args = array(
'post_type' => 'awsm_job_openings',
'post_status' => array( 'publish', 'expired', 'future', 'draft', 'pending' ),
'posts_per_page' => -1,
@techlemur
techlemur / list_blocks.js
Created February 11, 2019 21:19
get all available gutenberg block info for your site with javascript
/* Navigate to a wordpress edit page for any post and run one of the code sections below in a javascript console to get the names/info for all blocks available to gutenberg on your site. */
/* log all block info to console */
console.log(wp.data.select( "core/blocks" ).getBlockTypes());
/* log all block names to console */
wp.data.select( "core/blocks" ).getBlockTypes().forEach(function(element) {
console.log(element['name']);
});