Skip to content

Instantly share code, notes, and snippets.

@SanariSan
SanariSan / readme.md
Last active April 13, 2024 07:15
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":.+?,'
@rpanachi
rpanachi / db.rake
Created April 10, 2016 21:26
Rakefile for Sequel database operations
namespace :db do
require 'sequel'
Sequel.extension(:migration)
MIGRATIONS_PATH = 'db/migrations'
def db_conn_env
ENV["BOOKSHELF_DATABASE_URL"]
end
@imrahil
imrahil / calibration.gco
Last active July 16, 2018 01:20
Parameterized GCODE Script for OctoPrint - quick and dirty bed / Z axis calibration
{% set x_count = parameters.x_count %}
{% set y_count = parameters.y_count %}
{% set x_step = printer_profile.volume.width / (x_count - 1) %}
{% set y_step = printer_profile.volume.depth / (y_count - 1) %}
{% set zhop = parameters.z_hop %}
{% set speed = parameters.travel_speed %}
{% set speed_z = parameters.z_speed %}
{% set pos_X = 0 %}
{% set pos_Y = 0 %}
M117 run {{ script.name }}
@rogerleite
rogerleite / fluentd_links.md
Created March 19, 2015 16:24
Fluentd links
@pcreux
pcreux / pipable.rb
Last active June 12, 2018 17:08
*nix has pipes, Elixir has pipes, Ruby deserves pipes.
# Elixir has pipes `|>`. Let's try to implement those in Ruby.
#
# I want to write this:
#
# email.body | RemoveSignature | HighlightMentions | :html_safe
#
# instead of:
#
# HighlightMentions.call(RemoveSignature.call(email.body)).html_safe
#
@bonndan
bonndan / .Xmodmap
Created March 18, 2014 21:21
xmodmap config for apple keyboard under ubuntu
! clean most of the modifiers
clear control
clear mod4
clear mod1
! gt, lt
keycode 49 = less greater less greater bar brokenbar bar
keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
! -----------------
#!/bin/zsh
#
# Highlight a given file and copy it as RTF.
#
# Simon Olofsson <simon@olofsson.de>
#
set -o errexit
set -o nounset
@emad-elsaid
emad-elsaid / share-screen.rb
Created February 22, 2014 10:30
share your screen on the local network
require 'socket'
require 'base64'
Refresh = 1 # seconds to refresh image on server
screen_capture_command = 'screencapture -C -x tmp.png'
image = ''
latest = Time.now
server = TCPServer.new 3000
loop do
@pbalduino
pbalduino / autores.clj
Last active August 29, 2015 13:56
09. Qual autor tem mais livros publicados?
(ns autores.core
(:require [clojure.pprint :as pp]
[net.cgrand.enlive-html :as en]
[clojure.string :as str])
(:import [java.net URL]))
(defn- get-links [url]
(let [links (-> url
URL.
en/html-resource