carbonate icon indicating copy to clipboard operation
carbonate copied to clipboard

Feel free to create tickets in this repository to experiment with the Action

Open callmekatootie opened this issue 3 years ago • 22 comments

This repository also uses the action so you can get a taste of how it works to help with your decision on installing the Action or not.

Feel free to create random tickets. If anything needs my attention, please @ tag me and I will take a look else I shall ignore your experiments : )

Test sample code:


View raw code

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => {
  res.send('Hello World!')
})

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})

Reference http://expressjs.com/en/starter/hello-world.html

callmekatootie avatar Aug 23 '20 05:08 callmekatootie

How about now:


View raw code

export default function truncate(str, length = 100, ending = '...') {
  if (str.length > length) {
    return str.substring(0, length - ending.length) + ending;
  }
  return str;
}

callmekatootie avatar Jan 25 '22 12:01 callmekatootie

Hey check out this solution.


View raw code

export default function truncate(str, length = 100, ending = '...') {
  if (str.length > length) {
    return str.substring(0, length - ending.length) + ending;
  }
  return str;
}

bdougie avatar Feb 01 '22 23:02 bdougie

Hmm, let me try PHP code without putting PHP in markdown ...


View raw code

<?php
echo rand(10, 100);
?>

Edit: Hmm... Seems like the picture is too big for short code like this?

Good Job!

chengkangzai avatar Feb 03 '22 17:02 chengkangzai


View raw code


why


WHY


sdomi avatar Feb 03 '22 17:02 sdomi


View raw code

What's the need for this?

Shivam010 avatar Feb 03 '22 17:02 Shivam010

So - one use case is for mobile devices. When viewing the github issue on mobile, you will have to scroll the code blocks, which is not a good user experience.

Instead, if you replace the code blocks with an image of the code, it becomes easier to read it - you can easily zoom in and out and move the image around to read it instead of scrolling...

This action won't check if you have really entered code in your code blocks... :wink:

callmekatootie avatar Feb 03 '22 17:02 callmekatootie

Where was this posted btw? Just want to know why the sudden traffic :smile:

callmekatootie avatar Feb 03 '22 17:02 callmekatootie

Github posted: https://twitter.com/github/status/1489284307986305033?s=20&t=dznP0i6PgD-kWvKgY4AXvQ

Fryuni avatar Feb 03 '22 17:02 Fryuni

Where was this posted btw? Just want to know why the sudden traffic 😄

Have a guess ? https://twitter.com/github/status/1489284307986305033 😆

chengkangzai avatar Feb 03 '22 17:02 chengkangzai

Oh neat!

callmekatootie avatar Feb 03 '22 18:02 callmekatootie

Where was this posted btw? Just want to know why the sudden traffic :smile:

On LinkedIn too! :D

I'm inserting a code block too, cuz why not?!


View raw code

System.out.println("Carbonate is cool!! Excited to try it out");

VishnuSanal avatar Feb 03 '22 19:02 VishnuSanal

lemme see it in action :)


View raw code

public class Cool
{
    public string Staff { get; set; }
}

Cool cool = new();
cool.Staff = "Carbonate";

LazZiya avatar Feb 03 '22 19:02 LazZiya

🐫


View raw code

    .--' |
   /___^ |     .--.
       ) |    /    \
      /  |  /`      '.
     |   '-'    /     \
     \         |      |\
      \    /   \      /\|
       \  /'----`\   /
       |||       \\ |
       ((|        ((|
       |||        |||
      //_(       //_(

cauli avatar Feb 03 '22 20:02 cauli

If this works, it'll be very happy


View raw code

for i in range(100):
    print("Hello, World")

print("Goodbye, World")

Pencilcaseman avatar Feb 03 '22 21:02 Pencilcaseman

Hey


View raw code

def main():
    print("Good")

niasand avatar Feb 04 '22 03:02 niasand


View raw code

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"

AbreuY avatar Feb 04 '22 05:02 AbreuY


View raw code

print("Salom, Dunyo!")

Hi @callmekatootie, this is a really cool thing. I wonder why it added ; to this code?

yakhyo avatar Feb 04 '22 06:02 yakhyo

@yakhyo the code runs through prettier - which added the semicolon.

callmekatootie avatar Feb 04 '22 08:02 callmekatootie

Testing char support:


View raw code

العربية

Türkçe

中文

አማርኛ

မြန်မာ


LazZiya avatar Feb 04 '22 08:02 LazZiya


View raw code

public enum ChemicalValues {

	OXYGEN("oxygen", 0xFFFFFFFF, 0, 90.19F, -1_141), HYDROGEN("hydrogen", 0xFF6CE2FF, 0, 20.28F, -70.85F),
	LIQUID_HYDROGEN("liquid_hydrogen", 0xFF898FFF, 0, 20.28F, 70.85F);

	private final String name;
	private final int color;
	private final int luminosity;
	private final float temperature;
	private final float density;

	/**
	 * @param name        The name of the chemical
	 * @param color       Visual color in ARGB format
	 * @param luminosity  Luminosity
	 * @param temperature Temperature in Kelvin that the chemical exists as a liquid
	 * @param density     Density as a liquid in kg/m^3
	 */
	ChemicalValues(String name, int color, int luminosity, float temperature, float density) {
		this.name = name;
		this.color = color;
		this.luminosity = luminosity;
		this.temperature = temperature;
		this.density = density;
	}

	public String getName() { return name; }

	public int getColor() { return color; }

	public float getTemperature() { return temperature; }

	public float getDensity() { return density; }

	public int getLuminosity() { return luminosity; }

}

Cy4Shot avatar Feb 04 '22 13:02 Cy4Shot

Does Python code get formatted correctly?


View raw code

# This is a comment
def main():
    print("Hello, World")

Pencilcaseman avatar Feb 05 '22 12:02 Pencilcaseman

So non javascript, like php or python - you would need to add plugins to prettier to format the code properly... Perhaps I should support defining your own plugins for prettier to use - that way I don't have to capture them all and yet owners can use the action for their specific language :thinking:

callmekatootie avatar Feb 05 '22 12:02 callmekatootie

That would be a pretty neat feature!

Pencilcaseman avatar Feb 05 '22 12:02 Pencilcaseman