HTMLPen – Free Online HTML authoring tool

HTMLPen is the most advanced online Visual HTML Editor and Text Editor available.

Some HTML features are :

  • Free Visual WYSIWYG Editor
  • Instant Previews and JS Previews
  • Advanced HTMLCSS and JS Color Coding and Code Completion.
  • Embedded HTML, CSS and JavaScript Beautifier.
  • Advanced Color Picker with Alpha Channel
  • Embedded Image to Base64 Converter
  • Respects your Privacy. No data ever leaves your computer
  • Stores your open projects on browser LocalStorage so you can keep working on them later

HTMLPen is also a powerful online Text Editor and Code Editor that can identify 144 different languages.

  • Syntax Highlighting
  • Code Completion
  • Can open Very Large (TB+) Files
  • Regex Search and Count Functions
  • Respects your Privacy. No data ever leaves your computer

HTMLPen can recognize many languages, including:

ABAP, ABC, ActionScript, ADA, Apache Conf, AsciiDoc, Assembly x86, AutoHotKey, BatchFile, Bro, C and C++, C#, C9 Search Results, Cirru, Clojure, Cobol, CoffeeScript, ColdFusion, Csound, Csound Document, Csound Score, CSS, Curly, D, Dart, Diff, Django, Dockerfile, Dot, Drools, Edifact, Eiffel, EJS, Elixir, Elm, Erlang, Forth, Fortran, FreeMarker, Gcode, Gherkin, Gitignore, Glsl, Go, Gobstones, GraphQLSchema, Groovy, HAML, Handlebars, Haskell, Haskell Cabal, haXe, Hjson, HTML, HTML (Elixir), HTML (Ruby), INI, Io, Jack, Jade, JavaJavaScriptJSON, JSONiq, JSP, JSSM, JSX, Julia, Kotlin, LaTeX, LESS, Liquid, Lisp, LiveScript, LogiQL, LSL, Lua, LuaPage, Lucene, Makefile, Markdown, Mask, MATLAB, Maze, MEL, MIXAL, MUSHCode, MySQL, Nix, Nix, NSIS, Objective-C, OCaml, Pascal, Perl, pgSQL, PHP, Pig, Powershell, Praat, Prolog, Properties, Protobuf, Python, R, Razor, RDoc, Red, RHTML, RST, Ruby, Rust, SASS, SCAD, Scala, Scheme, SCSS, SH, SJS, Smarty, snippets, Soy Template, Space, SQL, SQLServer, Stylus, SVG, Swift, Tcl, Tex, Textile, Toml, TSX, Twig, Typescript, Vala, VBScript, Velocity, Verilog, VHDL, Wollok, XML, XQuery, YAML

Made in sunny California.

HTMLPen.com 2018

You might also like:

Batchography: Autorun a Batch file script each time you open the command prompt

This is yet another short article from the many topics mentioned in the Batchography book. In this article, I am going to show you how to have a Batch file of your choice execute each time you open the command prompt.

Putting it simply, all you have to do is create a string registry value called AutoRun under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command then specify the path of the Batch script you want to run!

A useful AutoRun Batch script is a script that sets up command macros using the Doskey command, but that’s a topic for another time!
flower separator
Buy from Amazon:

Batchography: Arithmetic operations in Batch files

Did you know that you can do basic arithmetic operations in a Batch file script?

The syntax is simple:

set /A result=EXPR

For example, to add 10 and 20:

@echo off
set /p result=10+20
echo result=%result%

From the “SET /?” output, these are the supported arithmetic operations:

The /A switch specifies that the string to the right of the equal sign
is a numerical expression that is evaluated.  The expression evaluator
is pretty simple and supports the following operations, in decreasing
order of precedence:

    ()                  - grouping
    ! ~ -               - unary operators
    * / %               - arithmetic operators
    + -                 - arithmetic operators
    << >>               - logical shift
    &                   - bitwise and
    ^                   - bitwise exclusive or
    |                   - bitwise or
    = *= /= %= += -=    - assignment
      &= ^= |= <<= >>=
    ,                   - expression separator

Now, let’s make a simple interactive calculator:

@echo off
:main
  setlocal
  set /p num1=Enter first number:
  set /p op=Enter operator:
  set /p num2=Enter second number:

  set /a result=%num1% %op% %num2%

  echo Result is %result%

  endlocal

  goto :eof

When we enter: 4, * then 5, we get the following output:

Enter first number:4
Enter operator:*
Enter second number:5
Result is 20

The Batchography book covers this topic in details and more. Check it out!

You might also like:

Shuffling function addresses in C/C++ with MSVC

The Microsoft C/C++ compiler allows you to specify link order of functions or variables. Using the #pragma directive with either code_seg or data_seg and specifying the segment name and its sorting key, you can tell the linker how to place the object code in the final executable.

Let’s start with a simple example:

#pragma code_seg(push, ".text$EB009")
__declspec(noinline) void f1()
{
    printf("this is f1()\n");
}
#pragma code_seg(pop)


#pragma code_seg(push, ".text$EB005")
__declspec(noinline) void f2()
{
    printf("this is f2()\n");
}
#pragma code_seg(pop)


#pragma code_seg(push, ".text$EB001")
__declspec(noinline) void f3()
{
    printf("this is f3()\n");
}
#pragma code_seg(pop)

int main()
{
    f1();
    f2();
    f3();
    return 0;
}

When the code_seg pragma is used, we can specify where the subsequent code should lie (in which section in the PE file). When the section name contains the “$” sign, then the subsequent text is not part of the section name (the string prior to the “$”) and instead is used as a sorting key. Continue reading “Shuffling function addresses in C/C++ with MSVC”

Excerpts and notes from the “Soft Skills” book

A couple of years ago, I was reading the book entitled “Soft Skills” by John Sonmez. The book was super useful to me especially that I was exploring ways to improve my soft skills and learn all the tricks I can regarding how to start my own business, organize my time, etc.

In this blog post, I share with you some of the takeaways and excerpts from that book.

Continue reading “Excerpts and notes from the “Soft Skills” book”

Cryptocurrency acronyms

If you are in cryptocurrency, then you might have encountered one or more of the following acronyms and wondered what they meant. Here you go:

  • WTC: Welcome to Crypto
  • FUD: Fear, uncertainty and doubt. A propaganda to lower prices.
  • FOMO: Fear out of missing. This is when you invest out of fear and not of educated decisions.
  • HODL: Misspelling for “hold”. People say HODL so that you don’t sell your BTC and hang on unto them.
  • Mooning: Price going up extremely high.
  • FIAT: Government-issued currency, such as the US dollar.
  • Whale: Someone who owns lots of cryptos. They might sells them to manipulate the prices.
  • Bullish: An expectation that the price is going to increase.
  • Bearish: An expectation that the price is going to decrease.
  • ATH: All time high. The highest price a coin has ever been
  • Market Cap: Total supply x Current price
  • ICO: Initial Coin Offering. Like IPO for the stock market
  • ROI: Return on investment
  • Cold storage: Storing the crypto coins offline. Be it on a paper wallet or a hardware wallet.
  • BTFD: Buy the F*king dip
  • NADDIC: Never A Dull Day In Crypto
  • DYOR: Do Your Own Research

Note: This is a live post and will be updated with new acronyms in the future.

You might also like:

Batchography: Polyglot Batch files and C++ – Self compiling C++ script

This article is part of the Batchography articles series and today, I am going to show you how to write a valid Batch file that is also a valid C/C++ file. The Batch file part of the source can do anything, however in this article, its sole purpose will be to compile itself and run the compile C++ program.

Let’s get started with the Polyglot source code:

Continue reading “Batchography: Polyglot Batch files and C++ – Self compiling C++ script”

Programming with Emojis

I ran into the EmojiCode website. Emojicode is an open-source, full-blown programming language consisting of emojis.

I personally did not like that language, but it is worthwhile mentioning:

No idea what that code does…I don’t care 😉

Meanwhile, if you are a C++ programmer, enjoy the following, legitimate, piece of code that redefine keywords into emojis and then the fun starts:

You might  also like:

Zipping all files in a Git repository

Hello,

This is a quick / reference post illustrating how to archive (zip format) all the files in a branch in a Git repository.

From the command prompt, type:

 
git archive --format=zip -o files.zip master

Explanation:

  1. The “–format” argument lets you specify the archive type. I used the zip file format
  2. The “-o” argument lets you specify the output file name
  3. master” is the name of the branch to be archived.

 

flower separator
batchography-good-resDo you want to master Batch Files programming? Look no further, the Batchography is the right book for you.

Available in print or e-book editions from Amazon.
flower separatorYou might also like:

 

strtok() C++ wrapper

In this article, I share with you a simple C++ class that wraps the string tokenization function strtok(). The QuickTokenizer class makes it easy to tokenize and enumerate the tokens in a thread-safe manner.

The class code

//////////////////////////////////////////////////////////////////////////
class QuickTokenizer
{
private:
  char *buf;
  char *token;
  char *ctx;

  void FreeBuffers()
  {
    if (this->token != NULL)
    {
      free(this->token);
      this->token = NULL;
    }
    if (this->buf != NULL)
    {
      free(this->buf);
      this->buf = NULL;
    }
  }

public:
  QuickTokenizer() : buf(NULL), token(NULL)
  {

  }

  const char *Tokenize(
    const char *str,
    const char *tok)
  {

    this->buf = _strdup(str);
    this->token = _strdup(tok);

    return strtok_s(buf, token, &ctx);
  }

  const char *NextToken()
  {
    return strtok_s(NULL, token, &ctx);
  }

  ~QuickTokenizer()
  {
    FreeBuffers();
  }
};

Continue reading “strtok() C++ wrapper”

Detect executable format using Python

In this article, I am sharing with you a small Python script that lets you detect if a file is an executable file and what platform the executable is targeting.

The following formats for 32 bits and 64bits processors are supported:

  • Mach-O files: both regular and universal formats
  • Windows PE files
  • Linux ELF files

The script

#---------------------------------------------------------------------
EXEFLAG_NONE        = 0x0000
EXEFLAG_LINUX       = 0x0001
EXEFLAG_WINDOWS     = 0x0002
EXEFLAG_MACOS       = 0x0004
EXEFLAG_MACOS_FAT   = 0x0008
EXEFLAG_32BITS      = 0x0010
EXEFLAG_64BITS      = 0x0020

# Keep signatures sorted by size
_EXE_SIGNATURES = (
    ("\x4D\x5A", EXEFLAG_WINDOWS),
    ("\xCE\xFA\xED\xFE", EXEFLAG_MACOS | EXEFLAG_32BITS),
    ("\xCF\xFA\xED\xFE", EXEFLAG_MACOS | EXEFLAG_64BITS),
    ("\xBE\xBA\xFE\xCA", EXEFLAG_MACOS | EXEFLAG_32BITS | EXEFLAG_MACOS_FAT),
    ("\xBF\xBA\xFE\xCA", EXEFLAG_MACOS | EXEFLAG_64BITS | EXEFLAG_MACOS_FAT),
    ("\x7F\x45\x4C\x46\x01", EXEFLAG_LINUX | EXEFLAG_32BITS),
    ("\x7F\x45\x4C\x46\x02", EXEFLAG_LINUX | EXEFLAG_64BITS)
)

def get_exeflags(filepath):
    try:
        with open(filepath, "rb") as f:
            buf = ""
            buf_len = 0
            for sig, flags in _EXE_SIGNATURES:
                sig_len = len(sig)
                if buf_len < sig_len:
                    buf += f.read(sig_len - buf_len)
                    buf_len = sig_len

                if buf == sig:
                    return flags
    except:
        pass

    return EXEFLAG_NONE

Continue reading “Detect executable format using Python”

Introducing Ganxo v0.1 – An open source API hooking framework

Hello,

Today I release the first Alpha version of Ganxo (pronounced as “Gun Show” or “Gan Chou”), an open source API hooking framework. In Catalan, Ganxo means “hook”, thus the framework’s name.

Writing an API hooking framework was always on my to do list. I started developing Ganxo back in April 2016 and after two weeks of development during my free time, I got busy with other things and abandoned my efforts.

My initial goals were to accomplish the following before going public with it:

  • Support x86 and x64 hooking
  • Write a more extensive test suite
  • Fully document it

This past weekend, I decided to release Ganxo even though I have not met all my goals. As of today, Ganxo works on MS Windows and supports x86 API hooking. The groundwork is laid down and it should be easy to add x64 bits hooking support on Windows or even just port it to other operating systems.

Feel free to clone the code from here and start using it today.

Stay tuned, I plan more features in the coming future!

flower separator
batchography-good-resDo you want to master Batch Files programming? Look no further, the Batchography is the right book for you.

Available in print or e-book editions from Amazon.
flower separator

You might also like:

Batchography: Batch files and Unicode

Recently, I had to update my popular utility that resets NTFS files permission to support Unicode paths. I had to investigate how to add Unicode support in Batch scripts. It seems that this was a topic I forgot to add into my comprehensive Batch files programming book.

This article is the result of my investigation, in which I am going to show you how to add Unicode support to your Batch file scripts in 3 easy steps.

Continue reading “Batchography: Batch files and Unicode”

LICEcap – Record your desktop and create animated GIFs

LICEcap, from Cockos Incorporated, is a nice and free tool that allows you to record your desktop screen activity and later save the activity as an animated GIF. This comes in handy when you are creating a small tutorial of some sort.
The nice thing about LICEcap is that it is not only free but also supports Windows and macOS.

Features and options:

  • Record directly to .GIF or .LCF.
  • Move the screen capture frame while recording.
  • Pause and restart recording, with optional inserted text messages.
  • Global hotkey (shift+space) to toggle pausing while recording
  • Adjustable maximum recording framerate, to allow throttling CPU usage.
  • Basic title frame, with or without text.
  • Record mouse button presses.
  • Display elapsed time in the recording.

You might also like: