Skip to content

Instantly share code, notes, and snippets.

@imdkbj
imdkbj / setwebhook.js
Created January 27, 2020 16:01
Setup to listen telegram multiple bots on webhooks.
const axios = require('axios');
const apiurl = 'https://api.telegram.org/bot';
const serveraddress = 'https://yourdomain.com';
const tokens = ['3445345345:454545-iY_wE6wj_aKDJwKLXk', '453454545:gffgfgzbcfjhsdbflhjdsfvhjlvdsf'];
//set webhook
//you can make this as call as way you want.
webhookURL(tokens, 50, 8443, 'tgram');
async function webhookURL(bot_tokens, max_connections, port, from) {
@vladox
vladox / download_sentry_data.py
Last active April 13, 2024 01:00 — forked from bubenkoff/download_sentry_data.py
Download all sentry events for a project. Useful for data processing
"""Download sentry data.
usage:
python download_sentry_data.py <org>/<project> <api_key>
"""
import requests
import csv
import sys
if __name__ == '__main__':
{
"actstat": {
"convert": {
"actstatid": "int"
}
},
"addrobj": {
"null": [
"actstat",
"nextid",
@justinmc
justinmc / anchor_smooth_scroll.js
Last active May 14, 2019 19:52
Anchor Smooth Scroll - Angular Directive
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Anchor Smooth Scroll - Smooth scroll to the given anchor on click
* adapted from this stackoverflow answer: http://stackoverflow.com/a/21918502/257494
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
angular.module('yourapp').directive('anchorSmoothScroll', function($location) {
'use strict';
return {
restrict: 'A',
replace: false,
@weilu
weilu / moment-timezone-data.js
Created March 18, 2014 05:09
sample moment-timezone-data.js
// generated on http://momentjs.com/timezone/data/
// Selected timezones: Asia > All, America > All, Europe > All
moment.tz.add({
"zones": {
"America/Adak": [
"12:13:21 - LMT 1867_9_18 12:13:21",
"-11:46:38 - LMT 1900_7_20_12 -11:46:38",
"-11 - NST 1942 -11",
"-11 US N%sT 1946 -11",
@joeyates
joeyates / nth-commit
Created October 30, 2013 12:09
Check out the nth commit to master in a git repository. This command can be used during presentation to skip through the history of a repo.
#!/bin/bash
git checkout master
SHA1=`git rev-list HEAD | tail -n $1 | head -n 1`
git checkout $SHA1
@mattpodwysocki
mattpodwysocki / AsyncReadEx.cs
Created February 19, 2012 04:55
Async I/O read in C#
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Win32.SafeHandles;
namespace AsyncIO
{
internal static class NativeMethods
{