Forum Tips and Tricks


#1

Post your forum Tips and Tricks here!


Do you have some simple but useful tip that will save users time, or make their forum use much more rich with features? Post them here! Tips and Tricks should be short and to the point. Also, please don’t post questions here regarding anything other than the tips and tricks posted. I will organize and link to each relevant tip from this first post as the thread builds. If you have a way to improve a tip or trick, please make a suggestion. Thanks!

Please use these formatting techniques to submit your tips and tricks:


Table of Contents

for Tips and Tricks found in below posts

  1. Formatting your Code Examples is Easy
  2. Make Keyboard Shortcuts look Beautiful!
  3. Make Keywords stand out
  4. Fix Reply Box height with cool Bookmarklet
  5. Use the Search function

How to use a REST API to do a POST with Spark Core?
Spark Photon Expected Shipping Dates
Photon and the PIN_MAP[] challenge!
Am I Doing Something Wrong?
Power Saving modes
OLED Display Code Help
Serial.begin kills Setup() in Electron
Live data from photon shown on server
Blank page in HTML browser controller
Webhook Tutorial - Send an Email!
Particle Publish Event CURL not working
InfluxDB/Telegraf Webhook JSON error
Electron sleep problems, yet again
Probems with Serial1
Malfunctioning if statement
Electron reading digital pin state help request (novice)
Tying an MCP23008 to Particle
Sparkcore operating without an instruction
[SOLVED]AdaFruit_LSM303 errors
Spark-bouncer - Cloud+RFID based door access control - configure rules via cloud calls, handle >3000 keys on flash storage, live logging via publish, RFID OTP read/write/compares, bling!
Current sensor ACS712 error
Sharp Memory LCD Displays = Ultra Low Power
[Fixed] Webhooks callbacks are not reliable!
Welcome! Using Particle Forums and Forum Etiquette
#2

Formatting your Code Examples is Easy

Here is a quick tip that makes your posted code look beautiful.

// The following two line is for Local Builds, 
// but works fine in the Sparkulator (web IDE)
#include "application.h"

void setup() {
  pinMode(D7,OUTPUT);
}

void loop() {
  // Blinky code
  digitalWrite(D7,HIGH);
  delay(100);
  digitalWrite(D7,LOW);
  delay(100);
}

Here’s what my post looks like edited:


All you have to do is wrap your code in

```cpp

// my code
if(worldRuler == “ME”) {
play(VICTORY_SONG);
}

```

and it will look like this:

// my code
if(worldRuler == "ME") {
  play(VICTORY_SONG);
}

Make sure the

```cpp

and

```

are on their own lines!


Some further discussion about the language hints (e.g. cpp, java, …) can be found in this thread


Button to LED code not working
Home Security System with Arm Function Not working
Commenting styles, I have a dream
Commenting styles, I have a dream
Commenting styles, I have a dream
Why does D0 never turn off? (code help)
[Fixed/Solved] Calling a web PHP page not working anymore: after a code modification and flash
Simple PHP Page
Expose spark core connection ready and disconnect event to API in spark-protocol DeviceServer.js
Erratic mouse movement while Photon is plugged in
IFTTT Integration for notification on receiving a Twilio SMS doesn't work
Using spark.publish() json format
Thermal sensor AOSONG AM2302 project
Webhook to FIWARE
HttpClient Example Issues
Using Spark.publish
Using Tinker with my own code - HELP!
Spark core web relay
Examples of basic recipes
TCP server and client between two photons
Does pinSetFast work reliably?
Newbie: spark core locks me out
Detect movement by Electron RSSI project Success!
Read from RX/TX Pins
How to make the accelerometer on asset tracker work every times it has a change?
How to Display the Temperature readings?
AC dimmer Timer Interupt
#3

Make Keyboard Shortcuts look Beautiful!

Here is a quick tip that makes your keyboard shortcuts look beautiful. Every want to tell someone what keys to press, but you you type something like press CTRL + ALT + DEL to get to the Task Manager. Well, NO MORE! Check this out…

Just use the keyboard tags.

<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>Del</kbd>

Looks like the real thing!

Ctrl + Alt + Del


#4

Make Keywords stand out

To make keywords like function names or commands stand out of the text without putting them in a code block, you can use this symbol ` (grave accent) before and after the respective word (in some languages you might have to press SPACE after it to make it appear).
And the * does some magic, too :wink:

The text above was typed like this

 ... make `keywords` like ***function*** *names* or **commands** stand out ...

#5

Fix Reply Box height with cool Bookmarklet

The following link loads a twitter bootstrap html page (i.e., cool page) that’s shared from my Dropbox account (i.e., super hacky web hosting because It’s too easy to drag and drop it to my webhost through Filezilla FTP). It has a bookmarklet that you can drag up you your bookmarks bar and click while on any Discourse forum (such as this one) to change the reply box height to 200px. This is useful if you have maximized your reply box on a computer with a large monitor, and then switch to a smaller monitor computer with no way to shrink the reply box. This bookmarklet will reset your reply box height to something you can grab and resize.

Get the Fix Reply bookmarklet to instantly set your Reply box to a height of 200px.

Add this code to a Bookmark called Fix Reply:

javascript:(function()%7B%24('div%23reply-control').css('height'%2C'200px')%7D)()

#8

Hey @BDub, thanks for this it is a great help.

I have struggled with the issues you address here.

Thank you very much.

Now… more tips please!! :wink:


#9

Use the Search function

Contrary to popular belief, and prior experiences with those ‘old fashioned’ forums, Discourse provides a really well working search functionality. Please, for the sake of the community,USE THE SEARCH FUNCTION. It’s not that hard, and it provides reliable answers, for which you don’t have to scroll through the entire forum. For those who are visual learners:

The search button is the little looking glass at the top right corner, next to your profile image, and notification bubble.

To get more, and possibly more relevant, answers, please click the “show more” button, which is shown after entering a query. Shown in the picture below:

I know it’s easier to just open a new thread, ask your question, and wait for answers. But with the community growing, there will be more and more questions asked, and more time will have to be spent answering those. We’re absolutely okay with that, and you’re more than welcome to ask question. It will however clutter the forum if some questions have to be answered on 7 different topics, while they’ve been answered several times before. So I’d like to request it once more: please use the search functionalities, and don’t be afraid to read a bit before opening a new topic.

Thanks in advance!


How Photon connects to the Particle Cloud
#11

To bypass the incredibly annoying Ctrl + F hijacking that occurs in Discourse (this forum software) for select browsers, press Ctrl + F twice.

There’s a debate thread over at https://meta.discourse.org/t/options-to-disable-hijack-of-cmd-f-ctrl-f-and-keys-for-search/16875/31.


#14

To center an uploaded (via drag and drop, copy paste or the upload icon ) wrap it into this

<div align="center">
<img src="..." >
</div>

Output:


#15

Adding a spoiler block like this

What's it? This should not be seen immediately

<details>
<summary>What's it?</summary>
This should not be seen immediately
</details>