Skip to content

Instantly share code, notes, and snippets.

View mohsinr's full-sized avatar

Mohsin Rasool mohsinr

View GitHub Profile
@mohsinr
mohsinr / wp-one-time-functions.php
Created August 11, 2017 13:57
Assign tags to all posts in a custom post type, one time , quick and dirty code
<?php
# One time, assign missing tags
function assign_tag($id){
$row = unserialize(get_post_meta($id,'_nhome_meta',true));
$ownership = $row['OWNERSHIP'];
$tag = '';
@mohsinr
mohsinr / gutenberg-tweaks.php
Created November 20, 2018 11:38
Disable Gutenberg Everywhere But Keep Enabled for Blog Posts ie (cpt Post)
<?php
//Disable Gutenberg for all but keep Enabled for Blog Posts only
function wm_gutenberg_disable_cpt($can_edit, $post_type){
if($post_type != 'post'){
$can_edit = false;
}
return $can_edit;
}
add_filter('gutenberg_can_edit_post_type', 'wm_gutenberg_disable_cpt', 10, 2);
@mohsinr
mohsinr / style.css
Created July 31, 2019 08:21
keep bootstrap 3 panel collapsibles , expanded via CSS
#faqs-group .panel-collapse.collapse {display: block !important;}.faqs-section .panel-default>.panel-heading>a:after{display:none !important}
.faqs-section .panel-default>.panel-heading>a{
background-color: #0099a5!important;
margin-bottom: 0 !important;
border-radius: 4px 4px 0 0;
}
.faqs-section .panel-default{margin-bottom:20px !important;}
@mohsinr
mohsinr / 💁‍♀️ Karen Bot by @levelsio
Created January 9, 2026 12:02 — forked from levelsio/💁‍♀️ Karen Bot by @levelsio
💁‍♀️ Karen Bot is an AI robot that lets you report problems in your neighborhood or city to your local city council
<?php
// Karen Bot by @levelsio
//
// ask Claude Code or Cursor to adapt it to your city
// mine is for Lisbon in Portuguese but it should work with any city and any language!
// save it as council.php and add a Nginx route /council on your server to use it
// make sure to add /council?key= and set a key below to use it privately
//
// more info: https://x.com/levelsio/status/2009011216132526407?s=20