Skip to content

Instantly share code, notes, and snippets.

View sreecodeslayer's full-sized avatar
🎯
Focusing

Sreenadh T C sreecodeslayer

🎯
Focusing
View GitHub Profile
@sreecodeslayer
sreecodeslayer / agent_channel.ex
Last active August 28, 2019 10:49
Fake Synchronous calls using Asynchronous GenServers in Elixir
defmodule MyAppWeb.AgentChannel do
use Phoenix.Channel
alias MyAppWeb.Endpoint
alias MyApp.AgentCommand
def push(topic, event, payload) do
Endpoint.broadcast("agent:#{topic}", event, payload)
end
@sreecodeslayer
sreecodeslayer / settings.html.ex
Last active August 21, 2019 14:33
agent async status
<p>
<%= link "Agent", to: agent_path(@conn, :show) %>
<%= if @is_agent_online do %>
(Online: <span class="has-text-success"><%= @is_agent_online %></span>)
<% else %>
(Online: <span class="has-text-danger"><%= @is_agent_online %></span>)
<% end %>
</p>
@sreecodeslayer
sreecodeslayer / agent_channel.ex
Last active August 19, 2019 07:45
Agent - Phoenix Presence - WebSocket
defmodule MyAppWeb.AgentChannel do
use Phoenix.Channel
alias MyApp.Presence
@doc """
Used by backend agent
"""
def join("agent:" <> _agent_topic, _message, socket) do
send(self(), :after_agent_joined)
{:ok, socket}
@sreecodeslayer
sreecodeslayer / Dockerfile
Last active July 5, 2019 12:20
Jekyll docker file and NGINX default configuration
# ============================================================
# Build your jekyll blog
# ============================================================
FROM jekyll/jekyll:stable AS build
RUN mkdir /jekyll-minima
WORKDIR /jekyll-minima
# copy the blog source
COPY . .
@sreecodeslayer
sreecodeslayer / Dockerfile
Last active July 5, 2019 11:25
A sample plugin that appends a line to every post
FROM wordpress:php7.3-apache
WORKDIR /var/www/html
COPY ending-line/ wp-content/plugins/ending-line/
@sreecodeslayer
sreecodeslayer / flask_login_api.py
Created November 23, 2017 11:05
Use authorization decorator for UI Based session login as well as Auth Header Request like in Basic Auth
def validate_api_or_user(f):
@wraps(f)
def decorated(*args, **kwargs):
auth = request.authorization
print auth
if not auth: # no header set
if current_user.is_authenticated: # check active session
g.user = current_user
return f(*args, **kwargs)
else:

Product Init


Hey, glad you are here. Now let's get you settled into our Team. Before we look into our current products, we will try to familiarize some of the technologies that are used in production through some set of simple tasks. These tasks are meant to act as a stepping stone to learning the technologies mentioned below:

  • HTTP / REST Api, Read on here and here
  • Git, and Gitlab
  • Server Client relations
  • Backend programming (Server side implementation)
  • Frontend programming (Client side implementation)
#!bin/bash
# add Macbunutu ppa and themes ppa
sudo apt-add-repository -y ppa:noobslab/macbuntu && sudo apt-add-repository -y ppa:noobslab/themes
sudo apt-get update
# icons
sudo apt-get -y install macbuntu-os-icons-lts-v7
# cursors
sudo apt-get -y install macbuntu-os-ithemes-lts-v7
# launcher
sudo apt-get -y install slingscold