Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
callmekatootie opened this issue Aug 23, 2020 · 22 comments

Comments

@callmekatootie
Copy link
Owner

callmekatootie commented Aug 23, 2020

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 callmekatootie pinned this issue Aug 23, 2020
@callmekatootie callmekatootie changed the title Don't be afraid - feel free to create tickets to demo Don't be afraid - feel free to create tickets in this repository to experiment with the Action Aug 23, 2020
@callmekatootie callmekatootie changed the title Don't be afraid - feel free to create tickets in this repository to experiment with the Action Feel free to create tickets in this repository to experiment with the Action Feb 18, 2021
@callmekatootie
Copy link
Owner Author

callmekatootie commented Jan 25, 2022

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;
}


@bdougie
Copy link

bdougie commented Feb 1, 2022

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;
}


@chengkangzai
Copy link

chengkangzai commented Feb 3, 2022

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!

@sdomi
Copy link

sdomi commented Feb 3, 2022


View raw code


why


WHY


@Shivam010
Copy link

Shivam010 commented Feb 3, 2022


View raw code

What's the need for this?


@callmekatootie
Copy link
Owner Author

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... 😉

@callmekatootie
Copy link
Owner Author

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

@Fryuni
Copy link

Fryuni commented Feb 3, 2022

@chengkangzai
Copy link

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

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

@callmekatootie
Copy link
Owner Author

Oh neat!

@VishnuSanal
Copy link

VishnuSanal commented Feb 3, 2022

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

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");


@LazZiya
Copy link

LazZiya commented Feb 3, 2022

lemme see it in action :)


View raw code

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

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


@cauli
Copy link

cauli commented Feb 3, 2022

🐫


View raw code

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


@Pencilcaseman
Copy link

Pencilcaseman commented Feb 3, 2022

If this works, it'll be very happy


View raw code

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

print("Goodbye, World")


@niasand
Copy link

niasand commented Feb 4, 2022

Hey


View raw code

def main():
    print("Good")


@AbreuY
Copy link

AbreuY commented Feb 4, 2022


View raw code

from flask import Flask

app = Flask(__name__)

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


@callmekatootie
Copy link
Owner Author

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

@LazZiya
Copy link

LazZiya commented Feb 4, 2022

Testing char support:


View raw code

العربية

Türkçe

中文

አማርኛ

မြန်မာ


@Cy4Shot
Copy link

Cy4Shot commented Feb 4, 2022


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; }

}


@Pencilcaseman
Copy link

Pencilcaseman commented Feb 5, 2022

Does Python code get formatted correctly?


View raw code

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


@callmekatootie
Copy link
Owner Author

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 🤔

@Pencilcaseman
Copy link

That would be a pretty neat feature!

Repository owner deleted a comment from Jcillo507 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests