Skip to content

Instantly share code, notes, and snippets.

View revathskumar's full-sized avatar

Revath S Kumar revathskumar

View GitHub Profile
@revathskumar
revathskumar / ANSI-escape-sequences.md
Created March 17, 2024 18:29 — forked from ConnerWill/ANSI-escape-sequences.md
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@revathskumar
revathskumar / Hex.gren
Last active July 23, 2023 12:57
Convert a decimal integer to a hexdecimal string : port of https://github.com/rtfeldman/elm-hex
module Hex exposing (fromString, toString)
{-| Convert to and from Hex strings.
@docs fromString, toString
-}
import Math exposing ( modBy )
@revathskumar
revathskumar / CliArg.gren
Last active July 23, 2023 11:34
gen test function reading from cli argumant
module TestMain exposing ( main )
import Node
import Node.Program as Program exposing ( Program )
import Stream exposing ( Stream )
main : Program Model Msg
main =
Program.define
@revathskumar
revathskumar / tg-bot-api.md
Created April 23, 2023 13:00 — forked from SanariSan/readme.md
Telegram HTTP bot API via CURL | Send text, photos, documents, etc.

Here are some examples on how to use Telegram bot api via CURL

Prerequisites

For getting messages in private chat with bot

  • Create a bot using @BotFather, get it's token
  • Start conversation with bot
  • Run following curl command
curl https://api.telegram.org/bot/getUpdates | grep -Po '"from":{"id":.+?,'
@revathskumar
revathskumar / firstrun.sh
Last active September 10, 2022 07:16
First run
sudo su
#install Google Chrome unstable
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# install Sublime Text 3
add-apt-repository ppa:webupd8team/sublime-text-3
add-apt-repository ppa:cpick/hub
sh -c 'deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu trusty main" >> /etc/apt/sources.list.d/firefox-nighty.list'
@revathskumar
revathskumar / blogger.xml
Created August 24, 2012 18:44
My Blogger Template
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head prefix='og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# revathskumar: http://ogp.me/ns/fb/revathskumar#'>
<meta content='190751917666930' property='fb:app_id'/>
<meta content='article' property='og:type'/>
<meta expr:content='data:blog.url' property='og:url'/>
<meta expr:content='data:blog.pageName' property='og:title'/>
<meta expr:content='data:blog.pageName' property='og:description'/>
@revathskumar
revathskumar / dbcreate.sh
Last active August 19, 2019 14:55
Simple Migration for cuba and sinatra
rake db:create
@revathskumar
revathskumar / git-copy-sample.sh
Created March 13, 2012 13:47
Copy all chaged files with directory structure
./git-copy.sh aabb37fc243675de1194e38f75a554695ed3c111 7b6efc6a0731d0da7ce0d13b19098db2f7da224b ../uploads
template = "Price of the %s is Rs. %f."
# %s - string, %f - float and %d - integer
p template % ["apple", 70.00]
# prints Price of the apple is Rs. 70.000000.
(function() {
var buttonPrefix = "+";
var buttonTag = "button";
var categoryTag = "category";
var commandTag = "cmd";
var confirmTag = "confirm";
var displayTag = "display";
var errorTag = "error";
var formatTag = "format";
var linkedTag = "linked";