Skip to content

Instantly share code, notes, and snippets.

View KvanTTT's full-sized avatar

Ivan Kochurkin KvanTTT

View GitHub Profile
@bhamiltoncx
bhamiltoncx / classify21.g4
Created February 17, 2017 18:47
Unicode code point classifier using new ANTLR4 full Unicode syntax
/** classify21.g4
Automatically generated Unicode 9.0.0 codepoint classification grammar.
Generated by "makeGrammars.py".
Author: Jonathan D. Lettvin (jlettvin@gmail.com)
Date: 20161023
Legal: Copyright(c) Jonathan D. Lettvin, All Rights Reserved
License:GPL 3.0
@hsyhhssyy
hsyhhssyy / JavaCSharp.cs
Last active June 1, 2020 16:52
This code is valid in both Java and C#, and output the same.
public class JavaCSharp { public static void
//\u000Amain
//\u000A\u002F\u002A
Main//\u002A\u002F
(String[] args) {
//\u000ASystem.out.printf("%s",
//\u000A\u002F\u002A
Console.WriteLine(//\u002A\u002F
//\u000Anew Object[]{
"Hello World!"
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@smarr
smarr / truffle-material.md
Last active March 16, 2023 14:06
Truffle: Languages and Material
@DavidAnson
DavidAnson / common-markdown-mistakes.md
Last active March 7, 2024 04:57
A few common Markdown mistakes

The following snippets show some common Markdown mistakes.

Click the Raw button to see the source text and understand the author's intent.

GitHub's parser handles some of these cases; other parsers do not.

To catch these problems automatically:

@sharwell
sharwell / CaseInsensitiveInputStream.java
Created March 8, 2014 03:00
Case insensitive input stream for ANTLR 4
/*
* [The "BSD license"]
* Copyright (c) 2012 Terence Parr
* Copyright (c) 2012 Sam Harwell
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@rxaviers
rxaviers / gist:7360908
Last active May 8, 2024 20:51
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@lamprosg
lamprosg / qtxml.cpp
Created March 20, 2012 10:11
Writing and reading XML files with Qt - qxmlstreamwriter and qxmlstreamreader provided classes
//Writing and reading XML files with Qt - qxmlstreamwriter and qxmlstreamreader supported classes
void MyXMLClass::SaveXMLFile()
{
QString filename = QFileDialog::getSaveFileName(this,
tr("Save Xml"), ".",
tr("Xml files (*.xml)"));