Skip to content

Instantly share code, notes, and snippets.

View mennwebs's full-sized avatar

Menn mennwebs

View GitHub Profile
@mennwebs
mennwebs / function.php
Last active July 2, 2024 07:00 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@mennwebs
mennwebs / slack-files-downloader.sh
Last active July 1, 2024 03:34 — forked from greird/slack-files-downloader.sh
Download all files from a Slack workspace export folder.
#!/bin/bash
#
# This script will browse a Slack export folder and download all files in a new /export folder
#
# HOW TO:
# 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export)
# 2. Make sure you have jq installed (https://stedolan.github.io/jq/)
# 3. Place this file at the root of your Slack export folder, next to channels.json
# 4. Run `bash slack-files-downloader.sh` in your terminal
#
@mennwebs
mennwebs / functions.php
Created January 9, 2019 06:30 — forked from jay7793/functions.php
Sample WooCommerce API Product Update (พี่เม่น)
<?php
ติดตั้ง Woocommerce php sdk โดยใช้คำสั่งด้านล่างนี้ (ใช้ Command ในการตัดตั้ง)
// composer require automattic/woocommerce
// Setup:
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
function wc_init() {
@mennwebs
mennwebs / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console