Skip to content

Instantly share code, notes, and snippets.

@teaddict
teaddict / telegram_bot.md
Created February 19, 2024 08:22 — forked from zapisnicar/telegram_bot.md
How to create Telegram bot and send messages to group

How to create Telegram Bot and send messages to your group

  1. Create Telegram bot:

    Search for user @BotFather in Telegram app. Type /help in BotFather chat and wait for the reply. Type in the chat:

    /newbot

or select /newbot command from Help text. Answer few setup questions:

@teaddict
teaddict / mongoexport-all-collections-as-json--array.sh
Last active February 6, 2019 08:17
Export all MongoDB collections to JSON array
#!/bin/bash
DB=$1
COLLECTIONS=$(mongo localhost:27017/$DB --quiet --eval "db.getCollectionNames()" | jq -r '. | join(" ")')
for collection in $COLLECTIONS; do
echo "Exporting $DB/$collection ..."
mongoexport -d $DB -c $collection --jsonArray --pretty -o $collection.json
done
@teaddict
teaddict / CustomJacksonModule.scala
Last active June 8, 2018 23:02
CustomJacksonModule for Finatra with CamelCase strategy, default finatra jackson module uses SNAKE_CASE as namin strategy
import com.fasterxml.jackson.annotation.JsonInclude.Include
import com.fasterxml.jackson.core.JsonGenerator.Feature
import com.fasterxml.jackson.databind.ObjectMapper
import com.twitter.finatra.json.modules.FinatraJacksonModule
import com.twitter.finatra.json.utils.CamelCasePropertyNamingStrategy
object CustomJacksonModule extends FinatraJacksonModule {
override val serializationInclusion = Include.ALWAYS
@teaddict
teaddict / angularjs_directive_attribute_explanation.md
Created April 23, 2018 09:09 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@teaddict
teaddict / readme.md
Created February 6, 2018 20:57 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@teaddict
teaddict / .conkyrc
Last active November 21, 2017 12:51
conky profile
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
--[[
Conky, a system monitor, based on torsmo
Any original torsmo code is licensed under the BSD license
All code written since the fork of torsmo is licensed under the GPL
Please see COPYING for details