Skip to content

Instantly share code, notes, and snippets.

View Ironjanowar's full-sized avatar
💜

César Guzmán Ironjanowar

💜
  • FCM Travel
  • Madrid, Spain
  • 00:07 (UTC +01:00)
View GitHub Profile
# Use an official Elixir runtime as a parent image
FROM elixir:latest
RUN apt-get update && \
apt-get install -y postgresql-client && \
apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
defmodule NiceBot.Bot do
@bot :nice_bot
use ExGram.Bot,
name: @bot
def bot(), do: @bot
def handle({:command, "start", _msg}, context) do
answer(context, "Hi!")
defmodule NiceBot.Application do
use Application
def start(_type, _args) do
token = "378322483:AAFdz_7lJt69S5HO7ep2GgBqTc36AIo3Ouc"
children = [
ExGram,
{NiceBot.Bot, [method: :polling, token: token]}
]
defmodule NiceBot.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# List all child processes to be supervised
children = [
defp deps do
[
{:ex_gram, "~> 0.6"},
{:jason, "~> 1.1"}
]
end
defmodule NiceBot.MixProject do
use Mix.Project
def project do
[
app: :nice_bot,
version: "0.1.0",
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
deps: deps()
@Ironjanowar
Ironjanowar / bufs.el
Created January 19, 2018 11:30 — forked from prathik/bufs.el
Emacs - Switch to new notes buffer
(defun new-scratch-buffer-new-window ()
"Create a new scratch buffer in a
new window. I generally take a lot of notes
in different topics. For each new topic hit
C-c C-s and start taking your notes.
Most of these notes don't need to be
saved but are used like quick post it
notes."
(interactive)
(let (($buf (generate-new-buffer "notes")))