Instantly share code, notes, and snippets.

View main.go
// https://tutorialedge.net/golang/reading-console-input-golang/
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
View bootstrap.py
import os
import sys
import subprocess
import functools
run = functools.partial(subprocess.call, shell=True)
run('virtualenv -p python3 .env')
run('.env/bin/pip install --upgrade setuptools')
View list.md
  • list one
    • nested list
    • nested list 2
  • list two
View slacktg_bridge.py
"""
Copyright 2017 k4ml@twitter.com.
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
View cherrypy-intro.md

This assuming you are on Linux or OSX machine. Make sure python version is 3.5 and above.

Create your project directory, let say we're building application named webby:-

mkdir webby
cd webbpy

Create new virtualenv that will be the PYTHON that we will use going forward in this project:-

View install-python.md

This is on Ubuntu 14.04, but should work in any Linux/OSX system:-

mkdir -p $HOME/python/3.6
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xzf Python-3.6.0.tgz
cd Python-3.6.0/
./configure --prefix=$HOME/python/3.6
make
make test
View keybase.io
### Keybase proof
I hereby claim:
* I am k4ml on github.
* I am k4ml (https://keybase.io/k4ml) on keybase.
* I have a public key ASCZeLsQwrBVZescEQhSO6a9e0jJxvGbB0p9mw8_7epr_Ao
To claim this, I am signing this object:
View button.elm
import Html exposing (Html, button, div, text)
import Html.App as App
import Html.Events exposing (onClick)
main =
App.beginnerProgram { model = model, view = view, update = update }
-- MODEL
View README.md

Bot request

This is how telegram send the request:-

POST / HTTP/1.1
Host: xxx.ngrok.io
Content-Type: application/json
Content-Length: 247
Accept-Encoding: gzip, deflate
X-Forwarded-Proto: https
X-Forwarded-For: 149.0.16.14
View infomy.js
module['exports'] = function chat (hook) {
var TelegramBot = require('node-telegram-bot-api');
var token = hook.env['TG_TOKEN'];
// Setup polling way
var bot = new TelegramBot(token);
bot.setWebHook('https://hook.io/k4ml/infomy')
// Matches /echo [whatever]
bot.onText(/\/echo (.+)/, function (msg, match) {