Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
export function Td({id,children,className}){
return (
<td id={id} className={className ?? ''}>
{children}
</td>
)
}
export function Th({id,children,className}:{
<?php
/**
* Plugin name: Josh412
*/
add_filer( 'show_admin_bar', '__return_false' );
/**
* Category validation
*/
add_filter('pre_insert_term',function( $term, $taxonomy, $args){
$allowed_parents = [
@Shelob9
Shelob9 / blue.css
Created December 7, 2023 22:42
Tailwind CSS with links styled like links
@tailwind base;
@tailwind components;
@tailwind utilities;
a {
@apply underline text-blue-800 hover:text-blue-400 visited:text-purple-800
}
@Shelob9
Shelob9 / filter-wp-request.php
Last active December 1, 2023 14:54
Using pre_http_request filter to mock HTTP request responses in WordPress phpunit test https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/class-wp-http.php#L240-L262
<?php
class Test extends TestCase {
public function test_function_that_makes_api_request(){
add_filter('pre_http_request', function(){
return [
'body' => [
'id' => 1,
],
export async function sendSkeet({ text, agent, attatchments }: {
text: string,
agent: bsky.BskyAgent,
attatchments?: Attatchments,
}) {
const rt = new RichText({ text });
await rt.detectFacets(agent);
const post: any = {
$type: 'app.bsky.feed.post',
import bsky from '@atproto/api';
const { BskyAgent, RichText } = bsky;
import * as dotenv from 'dotenv';
import process from 'node:process';
dotenv.config();
const agent = new BskyAgent({
service: 'https://bsky.social',
});
import { BskyAgent, AtpSessionEvent, AtpSessionData } from '@atproto/api'
//https://github.com/bluesky-social/atproto/tree/main/packages/api
const bsAgent = async () => {
const agent = new BskyAgent({
service: 'https://bsky.app/',
persistSession: (evt: AtpSessionEvent, sess?: AtpSessionData) => {
// store the session-data for reuse
}
<?php
add_filter('get_default_comment_status', [
IM_M_Comments::class, 'get_default_comment_status'
], 100, 3 );
apply_filters( 'comments_open', [
IM_M_Comments::class, 'comments_open'
], 100, 2 );
class IM_M_Comments {