Skip to content

Instantly share code, notes, and snippets.

@scossar
scossar / log-error.php
Created August 23, 2023 09:49
A tiny WordPress plugin that writes a comma separated list of arguments to a debug.log file
<?php
/**
* Plugin Name: log error
* Version: 0.1
* Author: scossar
*/
function write_log( ...$log_items ) {
if ( true === WP_DEBUG ) {
foreach ( $log_items as $log_item ) {
@scossar
scossar / discourse_table_descriptions.txt
Last active August 19, 2023 13:29
Brief descriptions of Discourse's database tables
allowed_pm_users: Links a user with another user they are willing to receive private messages or chat direct messages from, specifying the users who can send messages to them.
anonymous_users: Facilitates "anonymous mode" by connecting a real user with an anonymous user through the master_user_id field.
api_key_scopes: Links API key permissions with corresponding API keys, specifying allowed resources, actions, and customizable parameters.
api_keys: Manages API keys, storing information such as user associations, creation details, allowed IP addresses, usage status, and hashed key values.
application_requests: Tracks site requests, recording counts per request type on a daily basis to monitor traffic patterns and usage trends.
assignments: Manages assigned topics, associating them with users for specific actions or follow-up, while retaining assignment status and including optional notes.
associated_groups: Facilitates group membership assignment through OAuth authentication, utilizing information from extern
@scossar
scossar / discourse_table_structure.sql
Created August 18, 2023 03:33
A list of the CREATE TABLE statements from the Discourse structure.sql file
--
-- Name: allowed_pm_users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.allowed_pm_users (
id bigint NOT NULL,
user_id integer NOT NULL,
allowed_pm_user_id integer NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
.pull-left{float:right;}.pull-right{float:left;}.show{display:block;}.hide,.hidden{display:none;}.invisible{visibility:hidden;}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;}.affix{position:fixed;}.clearfix:before,.commits-widget .commits-list li:before,.clearfix:after,.commits-widget .commits-list li:after{display:table;content:" ";}.clearfix:after,.commits-widget .commits-list li:after{clear:both;}.overflow-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.clickable{cursor:pointer;}.admin-contents table{width:100%;}.admin-contents table tr{text-align:right;}.admin-contents table td,.admin-contents table th{padding:8px;}.admin-contents table th{border-top:1px solid #e9e9e9;}.admin-contents table td{border-bottom:1px solid #e9e9e9;border-top:1px solid #e9e9e9;}.admin-contents table tr:hover{background-color:#f9f9f9;}.admin-contents table tr.selected{background-color:#eeeeee;}.admin-contents table .filters input{margin-botto
# The shared_children is a list of all files/folders in your project that need to be linked to a path in "/shared".
# For example a sessions directory or an uploads folder. They are created if they don't exist, with the type
# specified in the `type` key (file or directory).
# Example:
# project_shared_children:
# - path: "app/sessions"
# src: "sessions"
# type: "file" / "directory" // <- optional, defaults to "directory"
project_shared_children:
- path: web/app/uploads
@scossar
scossar / hooks-app.yml
Created April 17, 2015 20:29
hooks for Discourse app.yml to load a custom Discourse repo into the docker image
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
- exec:
cd: $home
cmd:
@scossar
scossar / SassMeister-input.scss
Last active August 29, 2015 14:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
// I'm testing this at http://sassmeister.com/ so I'll just copy the whole mixin
// source file here.
// Set the global $disc-direction;
// This is set in the main manifest file.
@scossar
scossar / SassMeister-input-HTML.html
Last active August 29, 2015 14:18
Generated by SassMeister.com.
<div class="test-box">
</div>
@scossar
scossar / SassMeister-input-HTML.html
Last active August 29, 2015 14:18
Generated by SassMeister.com.
<html>
<div class="scratch">
test
</div>
</html>
@scossar
scossar / SassMeister-input.scss
Created April 10, 2015 15:28
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
//$direction: ltr;
//$default-float: left;
//$opposite-float: right;
$direction: rtl;