Skip to content

Instantly share code, notes, and snippets.

@sudheerDev
sudheerDev / blah
Last active December 7, 2020 14:58
did:3:bafyreietqwm6mgix6jfyttwry74ft3rfvmyzjna4xt4spdkdyi2abvnnzi
[
{
"actionParam": "https://github.com/mattermost/mattermost-server",
"actionText": "Download",
"description": "your eyes only! [test](https://test.com)",
"image": "https://raw.githubusercontent.com/reflog/notices-experiment/master/images/2020-08-11_11-42.png",
"title": "Sysadmin notice title",
"id": "127",
"sysAdminOnly": true,
"teamAdminOnly": false
[
{
"id": "123",
"conditions": {
"audience": "all",
"displayDate": "> 2020-03-01T00:00:00Z",
"serverConfig": {
"PluginSettings.Test": true
},
"numberOfUsers": 2000
{"level":"debug","ts":1531823529.7227802,"caller":"web/handlers.go:50","msg":"GET - /api/v4/channels/4tqx1ha5qbfj5mqhnqsxqawj7e/posts/unread"}
{"level":"error","ts":1531823529.7244754,"caller":"app/server.go:60","msg":"Please check the std error output for the stack trace"}
{"level":"error","ts":1531823529.7298934,"caller":"app/server.go:61","msg":"[runtime error: invalid memory address or nil pointer dereference]"}
goroutine 2220 [running]:
runtime/debug.Stack(0x0, 0x0, 0x1c6d960)
/usr/local/Cellar/go/1.10.2/libexec/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
/usr/local/Cellar/go/1.10.2/libexec/src/runtime/debug/stack.go:16 +0x22
github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.recoveryHandler.log(0x2026060, 0xc421d1c140, 0x2026080, 0x28279d8, 0x1, 0xc4212b46f0, 0x1, 0x1)
/Users/sudheer.t/go/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers/recovery.go:89 +0x70
````
{
"data": {
"AboutLink": "https://about.mattermost.com/default-about/",
"AllowEditPost": "always",
"AndroidAppDownloadLink": "https://about.mattermost.com/mattermost-android-app/",
"AndroidLatestVersion": "",
"AndroidMinVersion": "",
"AppDownloadLink": "https://about.mattermost.com/downloads/",
"AvailableLocales": "",
{
"ServiceSettings": {
"SiteURL": "http://localhost:8065",
"LicenseFileLocation": "",
"ListenAddress": ":8065",
"ConnectionSecurity": "",
"TLSCertFile": "",
"TLSKeyFile": "",
"UseLetsEncrypt": false,
"LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
@sudheerDev
sudheerDev / dynamicLoadReducers.js
Last active September 5, 2023 03:22
replaceReducer example
// This part of code is copied from Dan Abramov answer - https://stackoverflow.com/a/33044701/2902013
import { combineReducers } from 'redux';
import { createStore } from 'redux';
//couple of reducers available as part of inital config of app.
import users from './reducers/users';
import posts from './reducers/posts';
function createReducer(asyncReducers) {
@sudheerDev
sudheerDev / createStore.js
Created August 10, 2017 04:59
bare bones of redux createStore.js
import isPlainObject from 'lodash/isPlainObject'
import $$observable from 'symbol-observable'
export var ActionTypes = {
INIT: '@@redux/INIT'
}
export default function createStore(reducer, preloadedState, enhancer) {
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
enhancer = preloadedState
var opts = {
method: 'GET',
body: 'json',
headers: {}
};
fetch('/get-data', opts).then(function (response) {
return response.json();
})
.then(function (body) {
//doSomething with body;
function callAjax(url, callback){
var xmlhttp;
// compatible with IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
callback(xmlhttp.responseText);
}
}
xmlhttp.open("GET", url, true);