Skip to content

Instantly share code, notes, and snippets.

@emschwartz
emschwartz / README.md
Last active March 12, 2026 03:16
The Most Popular Blogs of Hacker News in 2025

This is an OPML version of the HN Popularity Contest results for 2025, for importing into RSS feed readers.

Plug: if you want to find content related to your interests from thousands of obscure blogs and noisy sources like HN Newest, check out Scour. It's a free, personalized content feed I work on where you define your interests in your own words and it ranks content based on how closely related it is to those topics.

@ctoth
ctoth / CLAUDE.md
Created November 30, 2025 20:46
My Current global CLAUDE.md

Working with Q — Coding Agent Protocol

What This Is

Applied rationality for a coding agent. Defensive epistemology: minimize false beliefs, catch errors early, avoid compounding mistakes.

This is correct for code, where:

  • Reality has hard edges (the compiler doesn't care about your intent)
  • Mistakes compound (a wrong assumption propagates through everything built on it)
  • The cost of being wrong exceeds the cost of being slow

Beast Mode

Beast Mode is a custom chat mode for VS Code agent that adds an opinionated workflow to the agent, including use of a todo list, extensive internet research capabilities, planning, tool usage instructions and more. Designed to be used with 4.1, although it will work with any model.

Below you will find the Beast Mode prompt in various versions - starting with the most recent - 3.1

Installation Instructions

  • Go to the "agent" dropdown in VS Code chat sidebar and select "Configure Modes".
  • Select "Create new custom chat mode file"
@jcasabona
jcasabona / wc-membership-learndash.php
Created April 28, 2020 14:22
Update LearnDash Groups based on WooCommerce Membership
<?php
// Update group status when member status changes.
function cc_update_ld_group_from_member_status( $user_membership, $old_status, $new_status ) {
$ld_group_id = LEARNDASH_GROUP_ID;
$user_id = $user_membership->get_user_id();
$wp_user = get_userdata( $user_id );
if ( wc_memberships_is_user_active_member( $user_id, $user_membership->get_plan_id() ) ) {
ld_update_group_access( $user_id, $ld_group_id, false );
@jack-arturo
jack-arturo / wpf-learndash-require-enrolled.php
Created April 21, 2020 08:11
Modifies WP Fusion's course access permissions for LearnDash so users must be enrolled in the course to see the course page
<?php
// Check course access
function check_ld_access( $can_access, $user_id, $post_id ) {
if ( ! function_exists( 'sfwd_lms_has_access' ) ) {
return $can_access;
}
@yanknudtskov
yanknudtskov / functions.php
Last active May 13, 2020 03:17
WooCommerce Subscriptions and LearnDash, based on the work of https://thomaslecoz.com/learndash-with-woocommerce-subscriptions/#code-update
<?php
add_action('cancelled_subscription', 'remove_course_access', 10, 2);
add_action('subscription_put_on-hold', 'remove_course_access', 10, 2);
add_action('subscription_expired', 'remove_course_access', 10, 2);
add_action('activated_subscription', 'give_course_access', 10, 2);
function send_receipt($order_id){
//if($new_status == 'processing' && $status != 'completed' || $new_status == 'completed' && $status == 'processing'){
if($status != 'processing' && $status != 'completed') {
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active April 22, 2025 22:44
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@mgibbs189
mgibbs189 / test.js
Created July 31, 2018 17:21
Redirect when a facet is interacted with
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if (FWP.loaded && '' == FWP_HTTP.uri) { // if not the initial pageload, and we're on the homepage
window.location.href = '/listings/?' + FWP.build_query_string(); // redirect
}
});
})(jQuery);
@leepettijohn
leepettijohn / functions.php
Last active July 28, 2020 09:24
Gravity Forms - Dynamic Dropdown, Radio Button, Multi Select
<?php
/*-----------------------------------------------------------------------------------*/
/* Putting Locations in a Dropdown, Radio Button, or Multi-Select */
/* Helpful article - https://www.gravityhelp.com/documentation/article/dynamically-populating-drop-down-fields/ */
/*-----------------------------------------------------------------------------------*/
$location_form_id = 9;
add_filter( 'gform_pre_render_'.$location_form_id, 'populate_posts' );
add_filter( 'gform_pre_validation_'.$location_form_id, 'populate_posts' );
add_filter( 'gform_pre_submission_'.$location_form_id, 'populate_posts' );
add_filter( 'gform_pre_submission_filter_'.$location_form_id, 'populate_posts' );
@neilgee
neilgee / acf-js.js
Last active September 5, 2022 13:52
ACF Google Map - Get Directions Link
(function($) {
/*
* new_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0