Skip to content

Instantly share code, notes, and snippets.

View mrakcw's full-sized avatar
🏠
Working from home

MrakCw mrakcw

🏠
Working from home
View GitHub Profile
@mrakcw
mrakcw / index.html
Created December 17, 2021 05:18 — forked from fishchev/index.html
Minimal page structure/sample to trigger Telegram's IV template for https://teletype.in.
<!DOCTYPE html>
<head>
<title>$title</title>
<meta property="og:site_name" content="$site_name">
<meta property="og:description" content="$description">
<meta property="article:author" content="$author">
<!-- $image_url / link preview image is set using og:image property -->
<!-- <meta property="og:image" content="http://example.com/img.jpeg"> -->
<meta property="telegram:channel" content="@cor_bee">
@mrakcw
mrakcw / googleDoc2cleanHtml.js
Last active November 3, 2021 12:35
Google App Scripts - Google DOC to clean HTML
// Work script
function ConvertGoogleDocToCleanHtml() {
var body = DocumentApp.getActiveDocument().getBody();
var numChildren = body.getNumChildren();
var output = [];
var images = [];
var listCounters = {};
// Walk through all the child elements of the body.
for (var i = 0; i < numChildren; i++) {
var child = body.getChild(i);
@Bodheim
Bodheim / RegexTutorialURL.md
Last active October 1, 2021 18:24
url tutorial

URL Search Tutorial

In this Regex tutorial, I'll be covering how to search a page for a url. I'll be breaking down each part of the expression and explain what each part does.

Summary

/^(https?://)?([\da-z.-]+).([a-z.]{2,6})([/\w .-])/?$/

This is a regex used to match a URL. This set of characters looks like it means nothing but it is infact a search pattern to find a url.

@mrakcw
mrakcw / Restore_list.md
Last active October 2, 2021 20:26
Restore list
@fishchev
fishchev / index.html
Last active June 11, 2024 09:37
Minimal page structure/sample to trigger Telegram's IV template for https://teletype.in.
<!DOCTYPE html>
<head>
<title>$title</title>
<meta property="og:site_name" content="$site_name">
<meta property="og:description" content="$description">
<meta property="article:author" content="$author">
<!-- $image_url / link preview image is set using og:image property -->
<!-- <meta property="og:image" content="http://example.com/img.jpeg"> -->
<meta property="telegram:channel" content="@cor_bee">
@cor-bee
cor-bee / dev.to.yaml
Created August 23, 2019 17:35
Overdocumented Instant View Template for dev.to (https://instantview.telegram.org/contest/dev.to/template28/)
## General info:
# Function starts with @
# Variable starts with $
# Return of the most recently run function made by $@
# Key comments marked with ##
## Version of IV must be set first
~version: "2.1"
# Telegram doesn't support JW Player which is used in videoheaders
@yxod
yxod / product microdata opencart 2
Created May 29, 2019 06:09
product microdata opencart 2
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Product",
<?php if ($count_of_reviews > 0) { ?>
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "<?php echo $rating; ?>",
"reviewCount": "<?php echo $count_of_reviews; ?>"
},
@yxod
yxod / breadcrums opecnart 2
Created May 29, 2019 06:07
breadcrumbs with schema.org
<ul class="breadcrumb container" itemscope itemtype="http://schema.org/BreadcrumbList">
<?php foreach ($breadcrumbs as $i=> $breadcrumb) { ?>
<?php if($i==0) { ?><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $breadcrumb['href']; ?>" itemprop="item"><span itemprop="name"> <?php echo $breadcrumb['text'];?></span></a><meta itemprop="position" content="<?php echo $i+1; ?>" ></li><?php } elseif($i+1<count($breadcrumbs)) { ?>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $breadcrumb['href']; ?>" itemprop="item"><span itemprop="name">
<?php echo $breadcrumb['text']; ?></span></a><meta itemprop="position" content="<?php echo $i+1; ?>" ></li><?php } else { ?><li><?php echo $breadcrumb['text']; ?></li><?php } ?>
<?php } ?>
</ul>
@mayneyao
mayneyao / notion_api.js
Created February 18, 2019 09:59
Notion API
const axios = require('axios')
const { URLSearchParams } = require('url')
const getFullBlockId = (blockId) => {
if (typeof blockId !== 'string') {
throw Error(`blockId: ${typeof blockId} must be string`)
}
if (blockId.match("^[a-zA-Z0-9]+$")) {
return blockId.substr(0, 8) + "-"
+ blockId.substr(8, 4) + "-"
@briatte
briatte / .htaccess
Created January 6, 2019 11:32
Show RSS feeds on a Web page via pure JavaScript, incl. code to bypass Chrome's CORS policy.
# enable CORS policy
# https://gist.github.com/maxparm/3105526
<IfModule mod_rewrite.c>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Header add Access-Control-Allow-Headers: "Content-Type"
RewriteEngine on
RewriteBase /
</IfModule>