- Create a new Telegram bot:
- start a chat with BotFather;
- type
/newbot
, select a name (to be shown in chats) and handle for your bot; - note the bot token to access HTTP API - a long string with a colon in the middle (later referred to as
<token>
); - optionally
/setdescription
and/setuserpic
.
- Add the bot to the chat/channel and note its id:
- add the bot to a new or existing chat or group - this is where your bot will send notifications to;
- go to
https://api.telegram.org/bot<token>/getUpdates
(replace<token>
with your token); - within the
chat
part, find and note theid
field - a positive or negative number (later referred to as<chat_id>
).
- Programmatically send notifications:
export GITHUB_USER=magickatt | |
export GITHUB_TOKEN=secret | |
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk | |
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} |
@ECHO OFF | |
set OLDPATH=%PATH% | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 > NUL: | |
echo export INCLUDE='%INCLUDE%' | |
echo export LIB='%LIB%' | |
echo export LIBPATH='%LIBPATH%' |
// JS array equivalents to C# LINQ methods - by Dan B. | |
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
rsync (Everyone seems to like -z, but it is much slower for me)
- a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
- H: preserves hard-links
- A: preserves ACLs
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order
is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.