text:
---
layout: post
title: "Securing the service | RESTful Clojure, Part 4"
description: "Protect your new service's resource with authorization and authentication"
category: restful-clojure
tags: ["clojure", "REST", "authorization", "authentication", "tutorial"]
---

*Drum roll, please...* After more than a year, I finally have some time to pick
up this blog series on creating RESTful data APIs with Clojure. It is amazing to me
how much the Clojure ecosystem has changed (for the better) even in the past year.
One of these changes has been the release of the the [Buddy security library](https://github.com/funcool/buddy)
Okay, it has been around for over a year, but in the past few months or so, Buddy
has become the de-facto library for Clojure web app security.

Originally, I had planned on using [Friend](https://github.com/cemerick/friend) -
which I still think is a great library - but Buddy is far more flexible and jives
well with the Clojure community's focus of **building amazing things from small, composable parts**.
Buddy consists of modules for crypto, auth/auth, password hashing, and
message signing, which may be used together or a la carte. For our shopping list
API, we will use the auth and password hashing functionality of Buddy. We will
only be scratching the surface of both web security in general and the Buddy library
specifically, but I have listed some [Resources](#resources) at the end of this article
that are definitely worth a read/watch.

## Security Architecture

There are a number of options for securing a web service or data API. One of the
main considerations is whether the API will be consumed by other back-end services
or by front-end applications. In our case, the API will be consumed by a
JavaScript application directly, so we will provide a mechanism that will be
simple for that sort of client to consume.

We will introduce two different user types - `:user` and `:admin` - who will each
have different permissions in the system. Admins should be able to do everything
that regular users can as well as a few more privileged actions. Users will authenticate
with the system by providing an _auth token_ in an `Authorization` HTTP header,
which the server will verify to determine whether the auth token is valid
and which user it is associated with.

Note that for an application with higher security requirements, this approach
would probably not be sufficient because if a hacker got the auth token, they
could have access to the system without even knowing the identity of the user
that they were impersonating. However, as long as the initial token request _as
well as every single request containing the token_ happens over HTTPS, we don't
need to be too worried.

If a logged-out client requests a resource that requires authentication, or if a
logged-in client an requests a resource that they are not authorized for, an
`HTTP 401 Unauthorized` response should be returned. Eventually, we would probably
want to return the 401 only for unauthenticated requests and use an
`HTTP 403  Forbidden` instead for requests that to not have adequate authorization,
but to make things simple for this tutorial, we'll stick with returning the 401
in both cases.

## Code, glorious code

With those high-level requirements outlined, let's start turning them into tests.
The previous tutorials were pretty code-heavy, but by now I assume that you know
how the project is organized, so I'll only include the most pertinent portions of
code. The full source code is available on [the companion repo](https://github.com/kendru/restful-clojure).

First, we'll implement password hashing for users. We want to be able to validate
a user's password without storing their password in the database in plain text.
Buddy's [hashers](http://funcool.github.io/buddy-hashers/latest/) module is
perfect for this.

### Passwords for users

{% highlight clojure %}
; test/restful_clojure/users_test.clj
; ...
(deftest authorize-users
  (let [user (users/create {:name "Sly" :email<EMAIL_ADDRESS>:password "s3cr3t"})
        user-id (:id user)]
    (testing "Accepts the correct password"
      (is (users/password-matches? user-id "s3cr3t")))

    (testing "Rejects incorrect passwords"
      (is (not (users/password-matches? user-id "not_my_password"))))))
; ...
{% endhighlight %}

Before we can write the code to get these tests passing, we need to create a
database migration adding a `password_digest` column to the `users` table. We also
need to add the buddy-hashers dependency to our `project.clj`. Once those steps
are complete, we're ready to update the `restful-clojure.models.users`
namespace.

{% highlight clojure %}
; src/restful_clojure/models/users.clj
; ...
(defn find-by [field value]
  (some-> (select* e/users)
          (where {field value})
          (limit 1)
          select
          first
          (dissoc :password_digest)))
; ...
(defn create [user]
  (-> (insert* e/users)
      (values (-> user
                  (assoc :password_digest (hashers/encrypt (:password user)))
                  (dissoc :password)))
      insert
      (dissoc :password_digest)))
; ...
(defn password-matches?
  "Check to see if the password given matches the digest of the user's saved password"
  [id password]
  (some-> (select* e/users)
            (fields :password_digest)
            (where {:id id})
            select
            first
            :password_digest
            (->> (hashers/check password))))
{% endhighlight %}

Most of this is pretty standard stuff for a web app, but notice that we are
taking care that the password is hashed and stored in the database but that even
the hash is never exposed to the client. When you run the tests now, you'll also
notice that they are much slower. This is due to the fact that the bcrypt algorithm
that Buddy uses by default to hash passwords is slow. Slowness is a good thing
when it comes to password hashing because the slower a hash algorithm is, the
less effective it renders brute-force attacks.

### Auth tokens

The next order of business is allowing users to supply their user id and password
and get an auth token that is valid for some specific amount of time. This time
I'll skip the tests because they are not very interesting.

We'll need to create a new migration that will create an `auth_tokens` table:

{% highlight sql %}
CREATE TABLE auth_tokens (
    id VARCHAR(36) PRIMARY KEY,
    user_id INTEGER REFERENCES users(id) ON DELETE CASCADE,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX ON auth_tokens (id, created_at DESC);
{% endhighlight %}

While we're at it, let's go ahead and create another migration adding a `level`
column to the users table to identify a user a being a "user" or "admin".

{% highlight sql %}
ALTER TABLE users ADD COLUMN level VARCHAR(12) NOT NULL default 'user';
{% endhighlight %}

We will bundle both authorization and authentication together into one "auth"
namespace. I'll show you the full code below, and then we'll walk through what it
does. This is probably the longest code sample in the tutorial, but it contains
most of the internals of auth, so try to follow along.

{% highlight clojure %}
; src/restful_clojure/auth.clj
(ns restful-clojure.auth
  (:use korma.core)
  (:require [restful-clojure.entities :as e]
            [restful-clojure.models.users :as users]
            [buddy.auth.backends.token :refer [token-backend]]
            [buddy.auth.accessrules :refer [success error]]
            [buddy.auth :refer [authenticated?]]
            [crypto.random :refer [base64]]))

(defn gen-session-id [] (base64 32))

(defn make-token!
  "Creates an auth token in the database for the given user and puts it in the database"
  [user-id]
  (let [token (gen-session-id)]
    (insert e/auth-tokens
      (values {:id token
               :user_id user-id}))
    token))

(defn authenticate-token
  "Validates a token, returning the id of the associated user when valid and nil otherwise"
  [req token]
  (let [sql (str "SELECT user_id "
                 "FROM auth_tokens "
                 "WHERE id = ? "
                 "AND created_at > current_timestamp - interval '6 hours'")]
    (some-> (exec-raw [sql [token]] :results)
            first
            :user_id
            users/find-by-id)))

(defn unauthorized-handler [req msg]
  {:status 401
   :body {:status :error
          :message (or msg "User not authorized")}})

;; Looks for an "Authorization" header with a value of "Token XXX"
;; where "XXX" is some valid token.
(def auth-backend (token-backend {:authfn authenticate-token
                                  :unauthorized-handler unauthorized-handler}))

;; Map of actions to the set of user types authorized to perform that action
(def permissions
  {"manage-lists"    #{:restful-clojure.models.users/user}
   "manage-products" #{:restful-clojure.models.users/admin}
   "manage-users"    #{:restful-clojure.models.users/admin}})

;;; Below are the handlers that Buddy will use for various authorization
;;; requirements the authenticated-user function determines whether a session
;;; token has been resolved to a valid user session, and the other functions
;;; take some argument and _return_ a handler that determines whether the
;;; user is authorized for some particular scenario. See handler.clj for usage.

(defn authenticated-user [req]
  (if (authenticated? req)
    true
    (error "User must be authenticated")))

;; Assumes that a check for authorization has already been performed
(defn user-can
  "Given a particular action that the authenticated user desires to perform,
  return a handler determining if their user level is authorized to perform
  that action."
  [action]
  (fn [req]
    (let [user-level (get-in req [:identity :level])
          required-levels (get permissions action #{})]
      (if (some #(isa? user-level %) required-levels)
        (success)
        (error (str "User of level " (name user-level) " is not authorized for action " (name action)))))))

(defn user-isa
  "Return a handler that determines whenther the authenticated user is of a
  specific level OR any derived level."
  [level]
  (fn [req]
    (if (isa? (get-in req [:identity :level]) level)
      (success)
      (error (str "User is not a(n) " (name level))))))

(defn user-has-id
  "Return a handler that determines whether the authenticated user has a given ID.
  This is useful, for example, to determine if the user is the owner of the requested
  resource."
  [id]
  (fn [req]
    (if (= id (get-in req [:identity :id]))
      (success)
      (error (str "User does not have id given")))))
{% endhighlight %}

First, we create a utility function for generating session identifiers, which
are cryptographically strong random bits that are base-64 encoded. While it would
be easier to use something like a UUID here, that would create a guessable
session identifier, making it much easier for a hacker to exploit the system. I
am using James Reeve's [crypto-random](https://github.com/weavejester/crypto-random)
library here, but any strong random generator is okay here (even pulling bytes
off of `/dev/urandom`).

Next, the `make-token!` function simple creates a new session in the database
associated with the given user id.

We then create a Buddy token-based authentication backend, that will hook into
our Ring middleware and look for a "Authorization" HTTP header, extracting the
token from that. If a valid token is found, Buddy will associate the returned
user in the Ring request map, which we can use to either require that the user is
logged-in or that they have a specific user level. The Buddy middleware will call
the `authenticate-token` function with the Ring request map and the token found
in the "Authorization" header and will expect a user if the token was valid and
`nil` otherwise.

Finally, we create a simple permission structure such that users can only manage
lists (create, add/remove products, etc.), and admins can manage products and
users in addition to everything that users can do. In order to create the user
hierarchy such that admins will inherit all user privileges, we will create an
ad-hoc hierarchy in the users namespace. We also need to make a few changes
additional changes to accommodate the addition of user levels. Most of the relevant
code from the users namespace is below.

{% highlight clojure %}
; src/restful_clojure/models/users.clj
; ...
(def user-levels
  {"user" ::user
   "admin" ::admin})
(derive ::admin ::user)

(defn- with-kw-level [user]
  (assoc user :level
              (get user-levels (:level user) ::user)))

(defn- with-str-level [user]
  (assoc user :level (if-let [level (:level user)]
                       (name level)
                       "user")))
; ...
(defn find-by [field value]
  (some-> (select* e/users)
          (where {field value})
          (limit 1)
          select
          first
          (dissoc :password_digest)
          with-kw-level))
; ...
(defn create [user]
  (-> (insert* e/users)
      (values (-> user
                  (assoc :password_digest (hashers/encrypt (:password user)))
                  with-str-level
                  (dissoc :password)))
      insert
      (dissoc :password_digest)
      with-kw-level))
; ...
{% endhighlight %}

The two changes here are that we create a hierarchy of `::user`s and `::admin`s
and that we convert between string representations for storage and keyword
representations for programmatic operation. Another minor detail is that we
ensure users with no level specified are always stored with the "user" type.

Finally, we make the necessary changes in our handlers to restrict endpoints to
logged-in users/users with the appropriate privileges. This is a good time to
refactor the handler namespace to extract the business logic for each route to
its own function. As the app grows, these will probably move into other namespaces,
so for now having the business logic isolated from the routing logic will come in
handy. With the routes cleaned up, it is now easier to see how the various
authorization rules play out with our application routes.

{% highlight clojure %}
; src/restful_clojure/models/users.clj
; ...
(defroutes app-routes
  ;; USERS
  (context "/users" []
    (GET "/" [] (-> get-users
                    (restrict {:handler {:and [authenticated-user
                                               (user-can "manage-users")]}
                               :on-error unauthorized-handler})))
    (POST "/" [] create-user)
    (context "/:id" [id]
      (restrict
        (routes
          (GET "/" [] find-user)
          (GET "/lists" [] lists-for-user))
        {:handler {:and [authenticated-user
                         {:or [(user-can "manage-users")
                               (user-has-id (read-string id))]}]}
         :on-error unauthorized-handler}))
    (DELETE "/:id" [id]
        (-> delete-user
            (restrict {:handler {:and [authenticated-user
                                 (user-can "manage-users")]}
                       :on-error unauthorized-handler}))))

  (POST "/sessions" { {:keys [user-id password]} :body}
    (if (users/password-matches? user-id password)
      {:status 201
       :body {:auth-token (make-token! user-id)}}
      {:status 409
       :body {:status "error"
              :message "invalid username or password"}}))

  ;; LISTS
  (context "/lists" []
    (GET "/" []
        (-> get-lists
            (restrict {:handler {:and [authenticated-user
                                       (user-isa :restful-clojure.models.users/admin)]}
                       :on-error unauthorized-handler})))
    (POST "/" [] (-> create-list
                     (restrict {:handler {:and [authenticated-user
                                                (user-can "manage-lists")]}
                                :on-error unauthorized-handler})))
    (context "/:id" [id]
      (let [owner-id (get (lists/find-by-id (read-string id)) :user_id)]
        (restrict
          (routes
            (GET "/" [] find-list)
            (PUT "/" [] update-list)
            (DELETE "/" [] delete-list))
          {:handler {:and [authenticated-user
                           {:or [(user-can "manage-lists")
                                 (user-has-id owner-id)]}]}
           :on-error unauthorized-handler}))))

  ;; PRODUCTS
  (context "/products" []
    (restrict
      (routes
        (GET "/" [] get-products)
        (POST "/" [] create-product))
      {:handler {:and [authenticated-user (user-can "manage-products")]}
       :on-error unauthorized-handler}))

  (route/not-found (response {:message "Page not found"})))
{% endhighlight %}

I admit that some of the nesting of routes within contexts can get a little ugly.
Many developers prefer to write "flat" routes with a little more duplication,
which is admittedly easier to read, but it can become more difficult to maintain
with code duplicated between a number of route definitions.

Note, however, how nicely we can express our auth requirements, as in the following
example extracted from the routes above:

{% highlight clojure %}
(restrict
  (routes
    (GET "/" [] find-list)
    (PUT "/" [] update-list)
    (DELETE "/" [] delete-list))
  {:handler {:and [authenticated-user
                   {:or [(user-can "manage-lists")
                         (user-has-id owner-id)]}]}
   :on-error unauthorized-handler}))
{% endhighlight %}

This very declaratively expresses that, "For finding, updating, and deleting
a specific list, we need the user to be authenticated and either be able to
manage lists or be the owner of the specific list". This, I think, is where
Clojure really shines - declarative APIs expressed as data. Did you notice that
we lay out our auth rules as some nested maps and vectors? I'll take that over
an imperative auth system any day!

## In Conclusion

I have only briefly glossed over a couple of the many security concerns that
web apps face. Please know that this is only the tip of the iceberg and that
there is much more to building a "bulletproof" web service that what was
covered here. That said, the authorization and authentication practices in
this tutorial should pretty much cover what you'll need to build into a typical
web service or application of this scale.

If you do not have the code for this tutorial, I'd recommend checking it out
from [its GitHub repo](https://github.com/kendru/restful-clojure) and playing
around with it. If you have been walking through these tutorials from
[part 1](/restful-clojure/2014/02/16/writing-a-restful-web-service-in-clojure-part-1-setup/),
then you should now have a complete, albeit simple, API server that you can deploy
and build a front-end app on!

Next up, we'll build a simple front-end app to consume our web service, then finally,
we will deploy it to a DigitalOcean droplet. Stay tuned!

### Resources:

- [Securing Clojure Microservices using buddy - Part 1: Creating Auth Tokens](http://rundis.github.io/blog/2015/buddy_auth_part1.html)
- [(Video) Aaron Bedra - clojure.web/with-security](https://youtu.be/CBL59w7fXw4)
- [OWASP Top 10](https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project#tab=OWASP_Top_10_for_2013)

### Go To

- [Part 1: Setup](/restful-clojure/2014/02/16/writing-a-restful-web-service-in-clojure-part-1-setup/)
- [Part 2: Getting a web server up and running](/restful-clojure/2014/02/19/getting-a-web-server-up-and-running-with-compojure-restful-clojure-part-2/)
- [Part 3: Building out the web service](/restful-clojure/2014/03/01/building-out-the-web-service-restful-clojure-part-3/)
- Part 4: Securing the service


text:
---
layout: page
title: Webinars (preview)
subtitle: Webinar series on large ensembles
permalink: /webinars_preview/
---

drafts for upcoming webinars. This page is not linked on the public website. Copy contents to webinars page when ready.

## September 13th 2020: [Dr. Andrea Dittus](https://research.reading.ac.uk/meteorology/people/andrea-dittus/) (University of Reading)
time: 9am MDT, 11am EDT, 4pm BST, 5pm CEST

**Role of aerosol forcing for recent Pacific decadal variability and other applications of large climate model ensembles**

Register here

*If you encounter problems with the registration form, try a different browser or [use this direct link to the form](https://docs.google.com/forms/d/e/1FAIpQLSffYSIumHpCUQ5O_C-L5nDFSrkp_qMHhDIA0hCoZoEjjdRcAg/viewform?usp=sf_link).*

![image](https://research.reading.ac.uk/meteorology/wp-content/uploads/sites/8/People/andrea_dittus.jpg){: style="float: left; width: 200px; padding-right: 10px"}

Andrea is a research scientist at the National Centre for Atmospheric Science and Department of Meteorology at the University of Reading. Her research focuses on understanding various aspects of historical and future climate variability and change. She is particularly interested in understanding how different forcing agents such as greenhouse gases and anthropogenic aerosols interact with internal variability, to shape the climate we experience across the globe.

---
## EGU special

For the next webinars taking place in May, we have a special format: for each webinar (duration 1 hour), we invite 3 speakers who also present in the SMILE session at EGU to talk about their work.

Registration: https://forms.gle/vG9nC7sKps5z9joUA

## Monday May 10, 5pm (CEST), 11am (EDT), 9am (MDT): EGU special part 1

Alexandra Jahn: Forced Changes in the Arctic Freshwater Budget Emerge in the Early 21st Century

Karin van der Wiel: Physical storylines of future European drought events like 2018 based on ensemble climate modelling

Nicole Ritzhaupt: Robustness of projections of European precipitation for seasonal means and seasonal extremes

## Monday May 17, 5pm (CEST), 11am (EDT), 9am (MDT): EGU special part 2

Timo Kelder: Seasonal predictions as a high-resolution large ensemble to study extreme events over recent decades

Gabrielle Dallaire / Richard Arsenault: Calibration of a reinforcement learning method with the ClimEx large ensemble and a weather generator for water management

Christopher Callahan: El Niño variability mediates 21st century growth effects of climate change

In June, we will resume with the standard format: one webinar per month with an invited speaker.

---

## October 12th 2020: [Dr. Laura Suarez-Gutierrez](https://www.mpimet.mpg.de/en/staff/laura-suarez-gutierrez/) (Max Plank Institute for Meteorology)
time: 9 am (MDT), 3 pm (GMT), 5 pm (CEST)

**Exploiting large ensembles for a better yet simpler climate model evaluation**

Register here

*If you encounter problems with the registration form, try a different browser or [use this direct link to the form](https://docs.google.com/forms/d/e/1FAIpQLSf0SDihqHllZMNa-FUvpyciTmgdeGmzcgvqKoZ913NtsllEMw/viewform?usp=sf_link).*

![image](https://large-ensemble.github.io/lauraphoto.jpg){: style="float: left; width: 200px; padding-right: 10px"}

We are pleased to announce Dr. Laura Suarez-Gutierrez as our next speaker in the webinar series. Laura Suarez-Gutierrez works as a postdoctoral researcher at the Max-Planck-Institute for Meteorology (MPI-M). Her research focuses on understanding the internal variability of European heat extremes on different timescales. Furthermore, she works on new and better ways of evaluating the forced trends and variability in climate models using SMILEs.

## Early August 2020: [Dr. Sarah Schlunegger](https://www.sarahschlunegger.com) (Princeton University)
time and date: TBD, early August 2020

**Large Ensemble Intercomparison of Anthropogenic Changes in Marine Biogeochemistry**

Register here

*If you encounter problems with the registration form, try a different browser or [use this direct link to the form](https://docs.google.com/forms/d/e/1FAIpQLSe7y7UuqB7juHBoDG5NQACdYScmPalE6PmqB6sUwRpJeB13fQ/viewform?usp=sf_link).*

![image](https://large-ensemble.github.io/pic_schlunegger.jpg){: style="float: left; width: 200px; padding-right: 10px"}

We are pleased to announce Dr. Sarah Schlunegger as our next speaker in the webinar series. Sarah Schlunegger is a postdoctoral researcher at Princeton University. Sarah is one of the scientists behind the GFDL Large Ensemble Suite. Her research focuses on understanding, quantifying and anticipating the impacts of climate change on the ocean, specifically the ocean carbon cycle and marine ecosystems.

---

## July 6th 2020: Dr. John Fyfe (CCCma)
time: 9 am (MDT), 3 pm (GMT), 5 pm (CEST)

**Quantifying the Influence of COVID-19 Emission Reductions on Climate, and Other Applications of the New CanESM5 Super Large Ensemble**

Register here

*If you encounter problems with the registration form, try a different browser, [use this direct link to the form](https://docs.google.com/forms/d/e/1FAIpQLSfpOKBOyct3_dr29_5TlrxFvIL3_bj-h7iNZYiS-7rYDRkCDw/viewform?usp=sf_link), or [contact Sebastian](mailto:sebastian.milinski@mpimet.mpg.de).*

![image](https://www.lakeheadu.ca/sites/default/files/uploads/111/Fyte.jpg){: style="float: left; width: 200px; padding-right: 10px"}

_Dr. John Fyfe. Senior Research Scientist at the Canadian Centre for Climate Modelling and Analysis, Victoria BC Canada_

We are pleased to announce Dr. John Fyfe as our next speaker in the webinar series. John is one of the scientists behind the Canadian large ensemble experiments. CCCma has not only produced a large ensemble with their CMIP5 model, but was the first modelling center that uploaded large ensemble simulations for a variety of CMIP6 experiments to ESGF.

{:style="clear: left"}

This webinar will be recorded.

---

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Hackaspresso
IoT project using a reclaimed electronic scale and this code running on a Spark Photon to tell you how many espresso shots are left in the kitchen

### What it needs:

* the load cell from an electronic scale ($5.00)
* HX711 Load Cell Amplifier ($4.59)
* Spark Photon ($19.00)
* wires and a breadboard ($2.00)

See [here](http://mindsoon.com/hackaspresso) for images on how to hook everything up. Then flash your Spark Photon with `/hackaspresso.cpp` and you're ready to start downing that coffee with the knowledge that you can keep tabs on its stock from afar.

repository: stephengreenfield/hackaspresso

branch_name: refs/heads/main

repo_name: stephengreenfield/hackaspresso


text:
# Test_webde
# UI Look
- The focus was not on UI, but structurally it was made to be sturdy and stable. Stack views were used for encapsulating UI components and also storyboards but many things were made programatically like Blocking Screen component
- First screen is the Start screen (application entry) and there the user has to input the city name which cannot have less than 3 characters
- If you turn off the internet on this first screen you will also receive an alert indicating that there is no Internet and you will not be able to proceed
- After entering the city, blocking screen appears while data is being download from the net. Received data is filtered by days and the result is shown in the table view. Each row is one day which in turns holds per hour info
- When tapping the day, a new table view appears with the 3 hour periods. Note that the same Table View component was reused intentionally
- When tapping the 3 hour period, detail screen is shown for selected time-frame where the detail screen is a very simple component (one UITextView) and data is dumped there in string form
- On 5 days Table view you also have switch in navigation bar to choose between the API and local JSON.
- For both cases, icons are downloaded and Cached to save on networking

# Architecture
- Apple design guidelines were used
- MVVM was used as the architecture pattern
- Unit test example has been written
- Helper classes have been used to perform non View Controller logic
- Dependancy injection has been used and caching of data avoided
- Components for UI have been made, like Blocking Screen for example
- View Models are Initialised by models (thus the unit test are possible)
- Networking library has been made as a separate networking layer with web services, decodable protocols, etc. It’s made to be very robust and I use this approach in all of my objects
- File structure is organised in the project to have folders like Components, Libs (Helpers, Networking), Resources, Sections, Models, ViewModels…

# Instruction
- Download the app, start the project and input your bundle ID, that is it, there are no dependencies


text:
[![Build Status](https://semaphoreci.com/api/v1/shourien/springrest/branches/master/shields_badge.svg)](https://semaphoreci.com/shourien/springrest)

## Customer Profile management REST Application

 This is a Spring Boot Application with a full-fledged REST API service exposed with Swagger 2.0 UI.
 It allows for CRUD operations on the customer profile information.

 __*This application is hosted on Microsoft Azure Cloud.**__

 Click the following link to access the  __[DEMO](http://appdemos.org)__

Default 2 users in the system and their corresponding details for Basic in-memory login

| User          | Password      |
| ------------- |:-------------:|
| admin         | *password*    |
| user          | *password*    |

### Architecture Diagram
![Architecture Page](https://i.imgur.com/AMLcQCp.png)

### Technology Stack
 * Spring Boot
 * Spring Rest
 * Spring JPA
 * Swagger 2.0
 * H2 in-memory DB
 * Docker Container
 * Open JDK 8
 * Maven 3

### Build Instructions
 If you need to run the project on Eclipse or IntelliJ following steps would help for a quick setup

 1. Open pom.xml with Intelij or Eclipse
 2. Run Main.java
 3. Open browser on http://localhost:8080/swagger-ui.html

### Docker Run Command
 If you require to directly run the service in docker environment then execute the following command to automatically pull and deploy locally from public docker cloud repository.

 `docker run -d -p 8080:8080 shouriendoc/springrest:1.0-SNAPSHOT`

### Integeration Tests
Semaphore is used to perform automatic continous integration [LINK](https://semaphoreci.com/shourien/springrest). The project is verfied for integrity using the Spring Boot Tester with Integration Tests written to ensure E2E working for each of the REST API.

### Application Guide

 * The landing page for this application is the Swagger based 2.0 UI. ![Landing Page](https://i.imgur.com/3ThZo4N.png, "Landing Page")

 * Rest resources exposed to the user for invoking API's. The corresponding documentation detailing the request/response and the ability to invoke the apis is also provided by Swagger seamlessly. ![API Listing](https://i.imgur.com/TTCGUIH.png, "Rest Resource Listing")

 * Following is an example to invoke the REST API below. This is the REST API to obtain details of the customer for a particular customer ID. ![Invoke API](https://i.imgur.com/HHPDYNA.png, "Rest API to fetch customer details")

* The REST response of the API as provided by Swagger. ![REST Response](https://i.imgur.com/LaDtmJV.png, "Rest API response to obtaining customer details")


text:
# Request for contributions

Please contribute to this repository if any of the following is true:
- You have expertise in Arduino/ESP8266 development, WiFi, or C/C++
- You want to help lower the burden to first time contributors
- You want this open source community to be more collaborative and inclusive

# How to contribute

Prerequisites:

- Familiarity with [pull requests](https://help.github.com/articles/using-pull-requests) and [issues](https://guides.github.com/features/issues/).
- Knowledge of [Markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents.
- Knowledge of [WiFi Deauth](https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack) for understanding the project.

In particular, this community seeks the following types of contributions:

- **Ideas**: participate in an issue thread or start your own to have your voice
heard.
- **Resources**: submit a pull request to add to RESOURCES.md with links to related content.
- **Outline sections**: help us ensure that this repository is comprehensive. if
there is a topic that is overlooked, please add it, even if it is just a stub
in the form of a header and single sentence. Initially, most things fall into
this category.
- **Writing**: contribute your expertise in an area by helping us expand the included
content.
- **Copy editing**: fix typos, clarify language, and generally improve the quality
of the content.
- **Formatting**: help keep content easy to read with consistent formatting.

## Bug reports

A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

1. **Use the GitHub issue search** — check if the issue has already been
   reported.

2. **Check if the issue has been fixed** — try to reproduce it using the
   latest `master` or development branch in the repository.

3. **Isolate the problem**.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? What would you expect to be the outcome? All these
details will help people to fix any potential bugs.

Example:

> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the serial output on pastebin
> `<pic>` - a photo of your build with apparent wiring
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).

## Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.

## Pull requests

Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

**Please ask first** before embarking on any significant pull request (e.g.
implementing features, refactoring code, porting to a different language),
otherwise you risk spending a lot of time working on something that the
project's developers might not want to merge into the project.

Please adhere to the coding conventions used throughout a project (indentation,
accurate comments, etc.) and any other requirements (such as test coverage).

gha_language: C

gha_license_id: MIT


text:
---
layout: page
title: Curriculum Vitae
---

Arinto Hadi Wiharyo

Senior Cloud Engineer

Lisbon, Portugal

<EMAIL_ADDRESS>

About Me

Ola!

I am Arinto

I am currently working as a senior cloud engineer for a telecommunication enterprise, specializing in Azure, AWS and GCP cloud productization.

Before working as a cloud engineer, I have worked as a data engineer, scrum master and product owner.

I am familiar with Scrum, Kanban and SAFe. Not to mention behaviour driven development with Gherkin.

I was born in Indonesia but I have lived in Finland, Sweden and now Portugal.

I spend my free time surfing, cycling, cooking and reading.

Experience

I have roughly five years experience with Azure, one year experience with AWS and less than six months experience with GCP.

My areas of expertise lies on the sweet of cloud product automization, analytics, project management, agile coaching and a little bit of pre-sales.

Industry Knowledge

Telecommunication

Financial Sector

Product Management

Logistics

My work

<p2>**Nokia Portugal**

Senior Cloud Engineer

January 2021 - Present
</p2>

<p2>**CGI Advanced Analytics Solutions**

Data Engineer, Scrum Master and Product Owner

December 2017 - December 2020
</p2>

<p3>**Bigdatapump (Acquired by CGI)**

Data Analyst

January 2016 - Present
</p3>

<p4>**Teampac**

ERP and Report Developer

June 2015 - December 2015
</p4>

<p5>**Lionbridge**

Software Tester (part time)

November 2011 - October 2012
</p5>

<p3>
Let's connect:
[LinkedIn](https://www.linkedin.com/in/arintohadiwiharyo)
[twitter](http://twitter.com/arintole)
</p3>

####Thanks for visiting!


text:
# [@memecoin_bot](https://t.me/memecoin_bot)
Code of the [@memecoin_bot](https://t.me/memecoin_bot) Telegram bot. Reputation + coin economy inside the Telegram chat.
# Installation and local launch
1. Clone this repo: `git clone https://github.com/backmeupplz/memcoin`
2. Create `.env` file with environment variables listed below
3. Run `yarn install` in the root folder
4. Run `yarn distribute`
# Environment variables in `.env` file
* `USERNAME` — Telegram bot username
* `TOKEN` — Telegram bot token
* `MONGO` — URL of the mongo db
* `SECRET` — Secret key to generate auth token
* `PORT` — Port for API server
* `ADMIN_ID` — ID of the super admin chat

Please, consider refering to provided `env.sample` for further docs.
# API docs
In order to use API, you will have to obtain an API token from [@borodutch](https://t.me/borodutch). After you obtain the API token, you can see it with the `/token` command in private chat with [@memecoin_bot](https://t.me/memecoin_bot). All requests to the API should contain `token` header with your API token as a string.

API contains of the following methods sent to `http://<IP_ADDRESS>:1337`:

## GET `/user/:id`
Gets user data by their chat id
### Receives:
* `id` — user chat id
### Returns:
* User information in the format:
```json
{
  "chatId": 12345,
  "name": "Nikita Kolmogorov",
  "balance": 10
}
```
## POST `/transfer`
Transfers memecoins from one user to another
### Receives:
* `senderId` — chat id of the user to send
* `receiverId` — chat id of the user to receive
* `amount` — number of memecoins to transfer
### Returns:
* Success JSON if everything is ok:
```json
{ "success": true }
```

# Continuous integration
Any commit pushed to master gets deployed to [@memecoin_bot](https://t.me/memecoin_bot) via [CI Ninja](https://github.com/backmeupplz/ci-ninja).
# License
MIT — use for any purpose. Would be great if you could leave a note about the original developers. Thanks!

repository: backmeupplz/memcoin

gha_language: TypeScript

repo_name: backmeupplz/memcoin


text:
---
title: "Dealing with security incidents"
weight: 40
type: docs
description: >-
  Information about procedures to deal with security incidents.
---

## Some procedures to deal with security events

Sites facing or suspecting a security incident on their resources have to follow
[Incident Handling Procedure](https://confluence.egi.eu/display/EGIBG/CSIRT+Incident+reporting)

New vulnerability issues of the middleware should be handled as defined in the
[related procedure](https://documents.egi.eu/public/ShowDocument?docid=3145)
with a guide what to do when [you find a vulnerability](https://go.egi.eu/svg).

Sites having critical vulnerabilities are handled according to
[SEC03 EGI-CSIRT Critical Vulnerability Handling Procedure](https://go.egi.eu/sec03),
and if they do not respond properly, they may face suspension.

repository: gwarf/documentation

gha_language: HTML

repo_name: gwarf/documentation


text:
REST (Representational State Transfer)

Constraints:
* Client <-> Server (request, response)
* Stateless Server

Uniform Interface
* Resources (n) - nouns
* HTTP verbs
    * GET: retrieve item(s)
    * POST: insert item
    * DELETE: remove an existing item
    * PUT: replace an existing item
    * PATCH: update a part of an item
* HATEOS (Hypermedia as the Engine of Application State)


text:
# digest-pure

## Introduction

This is a pure Haskell implementation of the
[digest](http://hackage.haskell.org/package/digest) package.

## Unit test

 * For random *ByteStrings*: does the output of *digest-pure* match that of
   *digest*?

## Benchmarks

Benchmarked on a Mac Mini 2010, 2.4GHz, using *Data.ByteString.Lazy*, best out
of five.

### adler32

    $ time ./adler32 data
    165386662

    real  0m0.447s
    user  0m0.150s
    sys   0m0.295s

### adler32-pure

    $ time ./adler32-pure data
    165386662

    real  0m2.224s
    user  0m1.924s
    sys   0m0.298s

repository: bitonic/digest-pure

repo_name: bitonic/digest-pure


text:
# [agdt-java-vector2D](https://github.com/agdturner/agdt-java-vector2D)

A modularised Java [2D](https://en.wikipedia.org/wiki/Two-dimensional_space) geometry library. The dimensions are defined by orthogonal coordinate axes X and Y that meet at the origin point <x,y> where the coordinates x=y=0. All points in this space can be defined as immutable [V2D_Point](https://github.com/agdturner/agdt-java-vector2D/blob/master/src/main/java/uk/ac/leeds/ccg/v2d/geometry/V2D_Point.java) instances with each coordinate stored currently as a [BigRational](https://github.com/eobermuhlner/big-math/blob/master/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigRational.java). I am considering changing this to allow for coordinates to be [Math_BigRationalSqrt](https://github.com/agdturner/agdt-java-math/blob/master/src/main/java/uk/ac/leeds/ccg/math/Math_BigRationalSqrt.java) numbers, [algebraic numbers](https://en.wikipedia.org/wiki/Algebraic_number) or possibly any [real number](https://en.wikipedia.org/wiki/Real_number).

## Dependencies
- [agdt-java-generic](https://github.com/agdturner/agdt-java-generic)
- [agdt-java-math](https://github.com/agdturner/agdt-java-math)
- [BigMath](https://github.com/eobermuhlner/big-math)
- Please see the [POM](https://github.com/agdturner/agdt-java-vector2d/blob/master/pom.xml) for details.

## Code status
This code is unstable research software.

## Development plans/ideas
- Develop more comprehensive unit tests.
- Improve documentation.
- Make a versioned release on Maven Central.
- As the [OpenJDK](https://openjdk.java.net/) develops some of the functionality may become redundant.
- Consider if it is appropriate to [contribute](https://openjdk.java.net/contribute/) any of this.

## Development history
The intention is to provide a summary of changes from one version to the next here.
### Origin
This code began development bundled together with lots of other code developed for an academic research project.

## Contributions
- Welcome.

## LICENSE
- [APACHE LICENSE, VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0)

## Acknowledgements and thanks
- The [University of Leeds](http://www.leeds.ac.uk) and externally funded research grants have supported the development of this library.
- Thank you [openJDK](https://openjdk.java.net/) contributors and all involved in creating the platform.
- Thank you Eric et al for the [BigMath](https://github.com/eobermuhlner/big-math) library.
- Thank you developers and maintainers of other useful Java libraries that provide inspiration.
- Thank you developers and maintainers of [Apache Maven](https://maven.apache.org/), [Apache NetBeans](https://netbeans.apache.org/), and [git](https://git-scm.com/) which I use for developing code.
- Thank you developers and maintainers of [GitHub](http://github.com) for supporting the development of this code and for providing a means of creating a community of users and  developers.
- Thank you developers, maintainers and contributors of relevent content on:
-- [Wikimedia](https://www.wikimedia.org/) projects, in particular the [English language Wikipedia](https://en.wikipedia.org/wiki/Main_Page)
-- [StackExchange](https://stackexchange.com), in particular [StackOverflow](https://stackoverflow.com/).
- Information that has helped me develop this library is cited in the source code.
- Thank you to those that supported me personally and all who have made a positive contribution to society. Let us try to look after each other, look after this world, make space for wildlife, and engineer knowledge :)


text:
# Region Selection Data Display
[Click for application](https://yulin-w.github.io/region-selection-data-display/)
## Disclaimer
The regions in this application, the data of this application, and this application in general are not intended to be exact nor do they represent personal views of the author. This application is provided without any warranty of any kind whatsoever, either express or implied.
## Example of use
Click to add a region to selection, click again to remove the region from selection.
![](https://raw.githubusercontent.com/Yulin-W/region-selection-data-display/master/example.gif)
## What this app does
- Allows easy selection of regions on the world map and displays some key indicators (World Dank data, most recent data that it at most from 5 years ago) including the sum of the selection, currently including
  - Population
  - GDP nominal
  - GDP per capital nominal
  - Land area
  - Arable land
  - Renewable internal freshwater
- Other features
  - Data table allows sorting by columns
  - Background basemap gives detailed geographic info of local region upon zooming
  - Hovering over regions will display the name of the region in the top right box
## Note
- Certain regions are omitted due to a lack of World Bank Data on them
- nation-data-preparer folder contains python script for extracting desired indicator data from World Bank Database and outputting it into a json file in its directory (to update the data in the app, this json file will need to be copied and pasted to replace the one in the src folder)
  - Currently very badly optimized; as in, the fetching is incredibly slow
- To add new indicators, need to first modify the python script, fetch the data, then modify the app.js alongside possibly adding extra summary stat definition if such is desired.
## Development notes
- Some key dependencies (check package.json for details)
  - Leaflet
  - React-leaflet
  - React
  - Material-UI
## Extra Acknowledgements
- Regions data source: World Bank (accessed via wbdata module)
- "geojson_nation.js" were modified from:
  - Data source: Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
  - Data transformed to geoJSON at https://geoconverter.hsr.ch/vector, provided by Geometa Lab at IFS HSR

repository: Yulin-W/region-selection-data-display

gha_language: JavaScript

repo_name: Yulin-W/region-selection-data-display


text:
---
# Documentation: https://sourcethemes.com/academic/docs/managing-content/

title: "Spanish II"
subtitle: "Carnegie Library of Pittsburgh"
summary: "The class is done for the semester"
authors: ["icaoberg"]
tags: ["clp", "pittsburgh"]
categories: ["Spanish II"]
date: 2016-12-12T10:00:00-00:00
lastmod: 2016-12-12T10:00:00-00:00
featured: false
draft: false
projects: ["latinx", "language"]

# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder.
# Focal points: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight.
image:
  caption: "Spanish II"
  focal_point: "Smart"
  preview_only: false
---

The class is done for this semester.

In the meantime, feel free to use the library resources to practice some Spanish. ¡Hasta el año que viene!

repository: icaoberg/academic-kickstart

repo_name: icaoberg/academic-kickstart


text:
# Sample Android App Using the Spotify Web API Wrapper

This sample app uses [the Spotify Web API Wrapper](https://github.com/kaaes/spotify-web-api-android) to make calls to the Spotify API. This code in particular searches for artists and displays the results in logcat.

[There is also a webcast for the Android Developer Nanodegree](https://plus.google.com/events/cdp78mckdd6hmg451ou41duc39s?authkey=COHHyoWfo5ukrQE) that goes through this example code.


text:
---
coverImageUri: 'http://assets.martinezmedia.net/brandonmartinez/2015/03/MartinezMedia-20150418192-WebReady.jpg'
title: 'Make a SASSy CSS Cocktail: Bourbon and Bitters Served Neat [Recap]'
datetime: '2015-03-21T13:45:17.000Z'
categories: 'technology'
tags: 'presentations,scss'
excerpt:
  "If you had the opportunity to attend my presentation at the 2015 GRDevDay or
  the 2015 Chicago Code Camp, thank you for coming out to see me. You'll find
  the abstract, presentation, and additional resources in this post."
---

If you had the opportunity to attend my presentation at the
[2015 GRDevDay](http://grdevday.org/) or the
[2015 Chicago Code Camp](http://www.chicagocodecamp.com/), thank you for coming
out to see me. You'll find the abstract, presentation, and additional resources
in this post.

## Abstract

With the popularity of CSS frameworks and preprocessors, there are many options
available for web developers in modularizing their styles. But once we've gotten
past some of the "do-it-all" frameworks like Twitter's Bootstrap, how can we
maintain more control but still ease our development?

Simple! Three small SASS libraries: Bourbon, Neat, and Bitters. Using these
three libraries, we can easily build and maintain a site's user interface,
including taking advantage of newer CSS3 features such as transitions,
transforms, and responsive design. In this session, we'll setup a SASS
environment and get to work building a UI that you can easily maintain even
after a few drinks.

[![MartinezMedia-20150418192-WebReady](http://assets.brandonmartinez.com/brandonmartinez/2015/03/MartinezMedia-20150418192-WebReady.jpg)](http://assets.brandonmartinez.com/brandonmartinez/2015/03/MartinezMedia-20150418192-WebReady.jpg)

## Presentation

<iframe src="http://brandonmartinez.github.io/Make-A-SASSy-CSS-Cocktail/slides/" height="402" width="604"></iframe>

[Open presentation in a new window.](http://brandonmartinez.github.io/Make-A-SASSy-CSS-Cocktail/slides/)

## Source Code

Source for the presentation as well as the demo pages can be found on GitHub:
[brandonmartinez/Make-A-SASSy-CSS-Cocktail](https://github.com/brandonmartinez/Make-A-SASSy-CSS-Cocktail).

## Additional Reading Material

- [Sass: Syntactically Awesome Style Sheets](http://sass-lang.com/)
- [SASS Style Guide](https://css-tricks.com/sass-style-guide/)
- [Bourbon](http://bourbon.io/)
- [Neat](http://neat.bourbon.io/)
- [Bitters](http://bitters.bourbon.io/)

repository: brandonmartinez/brandonmartinez

repo_name: brandonmartinez/brandonmartinez


text:
UI Regression Workshop
============

The five exercises outlined in this repo are aimed at providing an introduction to UI regression testing. They're designed to provide a partially real-world codebase from which to demo three tools: Wraith, PhantomCSS and DiffUX.

## Getting Started

1. Clone this repo to your local dev environment
2. Install dependencies by running `npm install`
3. Get started with [the first exercise](./exercises/1-Wraith.md)

## Having Installation Troubles?

Sometimes we customize our machines a little too much, or end up with an out of date dependency that just won't upgrade, causing installation frustration and dependency nightmares. If you're faced with a situation like this, here are a couple alternative ways to get things set up:

- Use [Cloud9IDE](http://c9.io), clone this repo and install the tools via its command line.
- Work off of a virtual machine using a tool like [Vagrant](https://www.vagrantup.com/).

## Technical Skills Required

- Basic understanding of the command line
- Intermediate understanding of CSS/SASS
- Intermediate understanding of JavaScript

repository: anirudhpec/UIRegression

repo_name: anirudhpec/UIRegression


text:
# README_MAKER

## Description
README_Maker is a command-line application that allows for quick and easy generation of a README file to get save time and energy. This will allow developers to spend more time working on finishing their project's and less time creating READMEs.

### Table of contents
1. [Description](#Description)
2. [Table of Contents](#Table-of-Contents)
3. [Installation](#Installation)
4. [Usage](#Usage)
5. [License](#License)
6. [Contributing](#Contributing)
7. [Tests](#Tests)
8. [Questions](#Questions)

## Installation
1. First fork the github https://github.com/Unbukn/README_MAKER repo on https://github.com/.
2. Clone your newly forked repo to a directory on your computer.
3. Open the [index.js](./index.js) file in your terminal.
4. Install the node dependencies to the application by entering:
```
npm i
```

## Usage
To create a readme for your project enter and complete all the prompts:
```
node index.js
```
A [demo video](https://youtu.be/uRBiRK0loAc) demonstrates the application being run and the markdown file that is created.

### The prompts explained
```console
? What is the title of the project
```
Information entered is displayed as the title of the README file and, the first heading inside of the markdown. Note: if no entry is made the file will be saved as ```YourProjectName.md```

```console
? Describe your project.
```
Information entered is displayed under the ```Description``` heading of the markdown. Note: if no entry is made ```A description of the project goes here.``` will be saved as a placeholder.

```console
? How do you install your application? Are there dependencies?
```
Information entered is displayed under the ```Installation``` heading of the markdown. Note: if no entry is made ```TBD``` will be saved as a placeholder.

```console
? How do you use your application?
```
Information entered is displayed under the ```Usage``` heading of the markdown. Note: if no entry is made ```To use, (the project title here) you need to do . . . ``` will be saved as a placeholder.

```console
? Select a license type.
```
Information entered is displayed under the ```License``` heading of the markdown. Note: if no entry is made ```MIT``` will be saved as a placeholder.

```console
? Who contributed to the project?
```
Information entered is displayed under the ```Contributing``` heading of the markdown. There is no default for this prompt.

```console
? List methods for testing the application..
```
Information entered is displayed under the ```Tests``` heading of the markdown. Note: if no entry is made ```npm run tests``` will be saved as a placeholder.

```console
? What is your github username?
```
Information entered is displayed under the ```Questions``` heading of the markdown. There is no default for this prompt.

```console
? What is your email address?.
```
Information entered is displayed under the ```Questions``` heading of the markdown. Note: if no entry is made<EMAIL_ADDRESS>will be saved as a placeholder.

## License
[![License MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://shields.io/)
Copyright (c) 2020 James_Hudgins

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## Contributing
This application was developed by James Hudgins. README_MAKER was made possible with the following technologies:
[Node.js](https://nodejs.org/api/fs.html)
[Inquirer,js](https://www.npmjs.com/package/inquirer)
[Terminal-link](https://www.npmjs.com/package/terminal-link)
[Shields.io](https://shields.io/)
[youtube](https://youtube.com)

## Tests
There are currently no tests available for this version of README_MAKER.

## Questions
Questions regarding this application should be sent via email to<EMAIL_ADDRESS>You can also contact me on github with additional questions -> https://github.com/Unbukn/


text:
---
layout: post
title: "Bringing Back the Flags! Keyboard Layout Indicator as Country Flags on Gnome"
excerpt: "A script for converting the keyboard layout indicator on Gnome from text to country flags"
tags: [gnome, linux, keyboard layout, country flags, python, x11, x11 config, arch linux, aur, customization, open-source]
date: 2023-01-21T13:10:08+01:00
comments: true
image:
  feature: posts/keyboard-layout-indicator/cover-keyboard-layout.jpg
  credit: PngTree
  creditlink: https://pngtree.com/free-backgrounds
---

[Gnome](https://www.gnome.org/) is a free and open-source desktop environment for Linux and Unix-like operating systems. It is one of the most popular desktop environments for Linux, and is the default desktop environment for many Linux distributions. Gnome is known for its simplicity, ease of use and a user-friendly interface. It is designed to be easy to use for people of all ages and skill levels and it's also fully themeable and customizable.

One of the features that Gnome used to offer was the ability to display country flags as the keyboard layout indicator. This feature was present in earlier versions of Gnome, but was removed in later versions. The thing is, users don't always agree with the decisions a product takes, so in this case as the product is open-source and highly configurable, it's much easier to customize it to our liking.

A few months ago I implemented a Python script which updates the config files related to X11, where Gnome fetches the information for the keyboard layout indicator, and changes the country codes to their flags instead.

## Current state

On Gnome, the keyboard layout is presented as the code of the language which is currently selected. In the example below, the English (US) keyboard layout is selected:

![Original Keyboard Layout indicator](/images/posts/keyboard-layout-indicator/gnome-keyboard-original.jpg "Original Keyboard Layout indicator")

## After the script

A country flag there looks nicer to me instead of the language. After this script runs, this is what that would look like for the English (US) keyboard layout:

![Modified Keyboard Layout indicator](/images/posts/keyboard-layout-indicator/gnome-keyboard-modified.jpg "Modified Keyboard Layout indicator")

Ps: Other keyboard layouts/languages are also available

### The switcher now looks like this

![Keyboard Layout switcher](/images/posts/keyboard-layout-indicator/keyboard-layout-switcher.jpg "Keyboard Layout switcher")

### In context

![Keyboard Layout screenshot](/images/posts/keyboard-layout-indicator/keyboard-layout-screenshot.jpg "Keyboard Layout screenshot")

## Installing

If you use [Arch Linux](https://archlinux.org/) or any distribution based on it, you can get it from [AUR](https://wiki.archlinux.org/title/Arch_User_Repository) using [yay](https://github.com/Jguer/yay):

```bash
yay -S x11-keyboard-flags
```

On other distributions which have nothing to do with Arch Linux, you can [get the source code](https://github.com/jonathas/x11-keyboard-flags) and install it manually.

## Using

Run it with sudo:

```bash
sudo x11-keyboard-flags
```

Then reset gnome-shell by pressing Alt+F2 and entering the "r" command.

The script makes a backup of the original evdev.xml file from X11 before running and then sets the flags in the original evdev.xml file

And that's it! After these steps you'll see the flags in your keyboard layout selector.

## Conclusion

This customization can enhance the visual representation of the keyboard layout and make the language switching process more intuitive. As a further step, you can include this script in the startup process of your OS so that even if the package related to the file that was changed gets updated, the country flags will still be there.


text:
# Supplemental Files for Medium Post - Predict Stock Price with Time-Series Statistical Learning

This folder consists the supplemental files for my Medium Post of Predict Stock Price with Time-Series Statistical Learning. In the post, we have made predictive models for Apple (AAPL) and Lockheed Martin (LMT). This folder consists of the code of predictive models train with the following algorithms:

Adaptive model (Facebook Prophet)

ARIMA model (pmdarima)

Holts-winters method (Statsmodel)

## Goal
To build a prototype predictive model for 2 stocks in order to build a model to predict 505 stock prices in the S&P 500 index. The prototype shall have a high R-square with the testing data between 2019 and May 2020.

## Data
The stock price is downloaded from Yahoo Finance and store in the relational database (Postgre) in local machine. You may find more detail on how the data is downloaded in the ETL Pipeline folder and the tables in the relational database in the Database Table folder.

## Files
There are 7 Python codes in this folder:

Prediction_AAPL_arima.py

Prediction_AAPL_fph.py

Prediction_AAPL_hw.py

Prediction_LMT_arima.py

Prediction_LMT_fph.py

Prediction_LMT_hw.py

Graph.py

All the files started with "Prediction" are the codes for the predictive models trained with different algorithms. Graph.py is the helping code to generate line charts of the prediction of stock price.

## Adaptive Model
There are 2 files trained with this algorithm: [Prediction_AAPL_fph.py](Prediction_AAPL_fph.py) and [Prediction_LMT_fph.py](Prediction_LMT_fph.py), which are the predictive models for Apple and Lockheed Martin, respectively. Facebook Prophet is used for model training.

Both files obtain 2 different time interval of stock price for model training:

Between 1997 and 2018 (model_max)

Between 2010 and 2018 (model_8yr)

The code first obtain data from the local database by querying with psycopg2. Then, change the column name to ds and y which is required by Facebook Prophet. After the model is trained, make a prediction and evaluate the accuracy with the testing data.

The R-square of model_max for Apple stock: Negative R-square

The R-square of model_8yr for Apple stock: 45%

The R-square of model_max for Lockheed Martin: 42%

The R-square of model_8yr for Lockheed Martin: 34%

## ARIMA model
There are 2 files trained with this algorithm: [Prediction_AAPL_arima.py](Prediction_AAPL_arima.py) and [Prediction_LMT_arima.py](Prediction_LMT_arima.py), which are the predictive models for Apple and Lockheed Martin, respectively. pmdarima is used for model training.

Both files obtain 2 different time interval of stock price for model training:

Between 1997 and 2018 (model_max)

Between 2010 and 2018 (model_8yr)

Fixed hyperparameter:

m = 12

seasonal = True

Hyperparameters Gird Search for Arima Model:

p between 1 and 3

q between 1 and 3

P between 1 and 3

Q between 1 and 3

d between 1 and 3

D between 1 and 3

The code first obtain data from the local database by querying with psycopg2. Then obtain the column of stock price and initalize the Arima model hyperparameters grid search by calling pmdarima.auto_arima(). The function will find the best hyperparameters and return the best model, prediction can be directly made from the returned object afterward. However, the grid search is very time consuming, each file of code is roughly take 30 minutes to run.

The R-square of model_max for Apple stock: Negative R-square

The R-square of model_8yr for Apple stock: Negative R-square

The R-square of model_max for Lockheed Martin: Negative R-square

The R-square of model_8yr for Lockheed Martin: Negative R-square

## Holt-Winters Method
There are 2 files trained with this algorithm: [Prediction_AAPL_hw.py](Prediction_AAPL_hw.py) and [Prediction_LMT_hw.py](Prediction_LMT_hw.py), which are the predictive models for Apple and Lockheed Martin, respectively. Statsmodels is used for model training, Statsmodel.tsa.holtwinters.ExponentialSmoothing() is the function to be used.

The length of time interval for model training does not matter too much in this algorithm. Only the stock price of both stocks in 2018 is sufficient for the predictive model.

The code first obtain data from the local database by querying with psycopg2. Then obtain the column of stock price and declare an object by calling ExponentialSmoothing() with the following fixed hyperparameters:

trend = 'mul'

seasonal = 'mul'

seasonal_periods = 4 (Each year has 4 quarters of business cycles)

The following hyperparameters are vary among stocks:

smoothing_level (Alpha in the equation)

smoothing_slope (Beta in the equation)

Both smoothing_level and smoothing_slope shall be obtained the best value through grid search, but the best value for both Apple and Lockheed Martin are (smoothin_level = 0.6, smoothing_slope = 0.25) and (smoothing_level = 0.8, smoothing_slope = 0.25), respectively.

The R-square of the model for Apple stock: 41%

The R-square of the model for Lockheed Martin: Negative R-square

## Graph.py
Graph.py has 1 function: generate_line_chart() which generate a line chart to visualize the stock price of training data, testing data, and the predictive stock price from either models. The function is designed to visualize training data, testing data and at least 1 predictive stock price data set, the 2nd predictive stock price data set is optional. The layout is fixed, except the chart title. The x-axis is fixed to be between 2016 and 2020. The file relies on the following packages:

pandas

datetime

Plotly

repository: iVibudh/stock-prediction

repo_name: iVibudh/stock-prediction


text:
Alias Control Block
===================

The Alias control block contains several control-signal generators and a
switching matrix. Control signals are routed via the matrix to one of 8
general control buses. These control buses are then sent to the audio
portions of the instrument where the signals they contain may be used to
modulate a wide variety of parameters.  Control signal sources within the
control block are directly available to other units within the control
block.

##Matrix

The switching matrix is at the heart of Alias.

###Sources

    :env1   - Envelope generators
    :env2
    :env3
    :lfo1   - Low Frequency Oscillators
    :lfo2
    :lfo3
    :step1  - a pulse counter
    :step2  - a pulse counter
    :div1   - a frequency divider with odd division ratios
    :div2   - a frequency divider with even ratios
    :div    - The sum of div1 and div2
    :lfnse  - low frequency noise
    :sh     - sample and Hold
    :freq   - note frequency in Hertz
    :period - period of note frequency (1/frequency)
    :keynum - MIDI key-number
    :gate   - Key gate signal, 0 all keys up, 1 any key down
    :press  - MIDI pressure
    :vel    - MIDI velocity
    :cca    - MIDI controller a
    :ccb    - MIDI controller b
    :ccc    - MIDI controller c
    :ccd    - MIDI controller d
    :a      - general bus a
    :b      - general bus b
    :c      - general bus c
    :d      - general bus d
    :e      - general bus e
    :f      - general bus f
    :g      - general bus g
    :h      - general bus h
    :con    - a constant 1
    :off    - a constant 0

###Destinations within the control block

    lfo1 frequency 1     -
    lfo1 frequency 2     -
    lfo1 wave 1          -
    lfo1 wave 2          -
    lfo2 frequency 1     -
    lfo2 frequency 2     -
    lfo2 wave 1          -
    lfo2 wave 2          -
    lfo3 frequency 1     -
    lfo3 frequency 2     -
    lfo3 wave 1          -
    lfo3 wave 2          -
    step1 trigger source -
    step1 reset source   -
    step2 trigger source -
    step2 reset source   -
    div1 amplitude       -
    div2 amplitude       -
    lfnoise frequency    -
    sh source            -
    a1                   - Each general control bus (a..h) has 2 inputs.
    a2                   - When both inputs are used the two signals
    b1                   - are multiplied. This allows for easy amplitude
    b2                   - control of one signal over another without
    c1                   - tying up an additional bus.
    c2                   -
    d1                   -
    d2                   -
    e1                   -
    e2                   -
    f1                   -
    f2                   -
    g1                   -
    g2                   -
    h1                   -
    h2                   -

Note this matrix destination list only applies to destinations internal to
the control block. The oscillator, filter and effects sections have their
own set of destinations.

##Envelopes

Alias uses three nearly identical envelope generators env1, env2 and
env3. Envelope 3 is dedicated to the overall amplitude control. The other
two envelopes have no pre-established connections. The envelopes have an
ADDSR form with 3 level and 4 time parameters.

    (env1 atk dcy1 dcy2 rel  :pk p :bp bp :sus s :invert i)
    (env2 atk dcy1 dcy2 rel  :pk p :bp bp :sus s :invert i)
    (env3 atk dcy1 dcy2 rel  :pk p :bp bp :sus s)

    atk     - attack time in seconds
    dcy1    - initial decay time in seconds
    dcy2    - second decay time in seconds
    rel     - release time in seconds
    :pk     - "peak" amplitude after attack segment.
    :bp     - "break point" amplitude after initial decay stage.
    :sus    - sustain level after second decay stage
    :invert - 0 or 1 indicating if envelope shape should be inverted.

Note that envelope 3 does not have an invert option, otherwise the three
envelopes are identical.

The three level parameters (pk, bp and sus) have a valid range between 0.0
and 1.0 inclusive. By setting pk less then bp the envelope form changes
from ADDSR to AADSR with two attack stages in place of two decay
stages. This feature may be use for delay onset envelopes.

##LFOs

The three LFOs are identical with continuously variable wave-shape between
negative slope sawtooth, triangle and positive slope sawtooth. The LFOS
have no fixed use but many of the patches use LFO1 for vibrato. By
assigning both LFO1 and cca (by default MIDI controller 1, the modulation
wheel) to the same control bus the modulation wheel controls the output of
the LFO and thus modulation depth.

    (lfo1 :fm1 [fsrc1 fdth1] :fm2 [fsrc2 fdth2]
          :wave1 [wsrc1 wdpth1] :wave2 [wsrc2 wdpth2])

    (lfo2 :fm1 [fsrc1 fdth1] :fm2 [fsrc2 fdth2]
          :wave1 [wsrc1 wdpth1] :wave2 [wsrc2 wdpth2])

    (lfo3 :fm1 [fsrc1 fdth1] :fm2 [fsrc2 fdth2]
          :wave1 [wsrc1 wdpth1] :wave2 [wsrc2 wdpth2])

    fsr1   - First frequency modulation source, may be any of the matrix
             source listed above.
    fdth1  - Modulation depth of fsrc1
    fsrc2  - Second frequency modulation source
    fdth2  - Modulation depth of fsrc2
    wsrc1  - First wave modulation source
    wdpth1 - Modulation depth of wsrc1
    wsrc2  - Second wave modulation source
    wdpth2 - Modulation depth of wsrc2

The LFOs do not have explicit frequency and wave parameters. Instead one of
the modulation sources may be set to a constant (:con) and the
corresponding depth parameter used to set the desired value. The wave
parameter has a range between 0.0 and +1.0 inclusive. At 0.5 the
waveform is a triangle, at 0.0 the waveform is a sawtooth with a negative
slope. At 1.0 a positive slope sawtooth is produced.

##Step Counters

There are two identical step counters. On reception of an input trigger
moving from non-positive to positive the counters advance one step. Upon
reaching a pre-determined value the output reverts to the initial
value. The nominal output has a stair-step shape an may be either
increasing or decreasing. A second reset input causes the input immediately
to switch back to the initial value and may be used for more complex output
shapes.

    (stepper1 :trig tsrc :reset rsrc :ivalue iv :min mn :max mx :step st :bias b :scale s)
    (stepper1 :trig tsrc :reset rsrc :ivalue iv :min mn :max mx :step st :bias b :scale s)

    :trig   - Trigger input source
    :reset  - Reset input source
    :ivalue - Initial value, upon reset output immediately switches to ivalue.
    :min    - Minimum output
    :max    - Maximum output
    :step   - Step size, output increment on reception of trigger
    :bias   - Fixed value added to output.
    :scale  - Scaling factor applied to output, scaling factor is applied prior to bias.

The output continuously cycles between min and max with increments set by
step. If min is greater then max then step should be negative. The min,
max, step and ivalue parameters should all be integers.

##Frequency Dividers

There are two frequency divider cascades, both driven by LFO3. The first
divider, div1, provides only odd division quotients: 1,3,5 and 7. The
second divider, div2, provides only even number quotients: 2,4,6 and 8. The
matrix source :div is the sum of div1 and div2.

    (divider1 :p1 p1 :p3 p3 :p5 p5 :p7 p7 :pw pw :am [asrc adpth] :bias b)

    :p1    - Relative weight of /1 divider
    :p3    - Relative weight of /3 divider
    :p5    - Relative weight of /5 divider
    :p7    - Relative weight of /7 divider
    :pw    - Common pulse width
    :asrc  - Amplitude scale source
    :adpth - Amplitude modulation depth
    :bias  - Fixed bias added to output.

The outputs of the four frequency dividers are scaled by their respective
scaling factors and then summed. This sum is then scaled to any amplitude
modulation determined by asrc and adpth. Finally the bias value is added to
form the overall divider output signal. The :pw parameter sets the pulse
width of all divider outputs in common. For pw=0.5 the dividers produce a
square wave. pw values slightly off 0.5 produce a kind of 'swing'
rhythm. pw values at the extremes (0 and 1) tend to produce short transient
pulses.

divider2 is identical to divider1 with exception of the division quotients.

    (divider1 :p2 p2 :p4 p4 :p6 p6 :p8 p8 :pw pw :am [asrc adpth] :bias b)

##Low Frequency Noise

    (lfnoise  :fm [src dpth])

    :src  - Frequency modulation source
    :dpth - Frequency modulation depth

Generates a random low frequency signal which changes at a rate
approximately determined by the fm src and depth parameters.

##Sample And Hold

The sample and hold circuit 'samples' a continuously changing input signal
at a pre determined rate and holds the value until the next sample
period. It is very common to use a noise source as input to a sample and
hold circuit to produce an endless stream of random values. Applying sample
and hold to lfnoise changes it from a continuously changing random value to
a series of discrete random values. For non-random input the sample and
hold can produce anything from regular patterns to highly complex periodic
output.

    (sh  :rate r :src src :bias b :scale s)

    :rate  - Sampling rate in Hertz
    :src   - Sampling input source
    :bias  - Fixed value added to output
    :scale - Scaling factor applied to output

The scale factor is applied prior to the bias value.

##Matrix Details

The general matrix consist of 8 buses labeled a..h. Within the control
block proper signal routing is more flexible. As a quick illustration env1
and lfo1 are contained in the control block while the audio oscillator osc1
is not. Since both env1 and lfo are in the control block env1 may be
directly used as a modulation source to lfo1 (or any other member of the
control block). In order for env1 to be used with osc1 however it must first
be assigned to one of the general matrix buses a..h.

Each general matrix bus has 2 inputs and a corresponding sensitivity
value. These two inputs are multiplied which effectively allows amplitude
modulation between the two input buses. If only one input is desired the
unused input __must__ be set to a constant with sensitivity 1. [:con 1]. If
either input source is set to :off the the bus output is 0.

    (matrix
        :a1 [src sens] :a2 [src sens]
        :b1 [src sens] :b2 [src sens]
        :c1 [src sens] :c2 [src sens]
        :d1 [src sens] :d2 [src sens]
        :e1 [src sens] :e2 [src sens]
        :f1 [src sens] :f2 [src sens]
        :g1 [src sens] :g2 [src sens]
        :h1 [src sens] :h2 [src sens])

Where src is any one of the matrix sources :env1 :env2 :env3 :lfo1 :lfo2
:lfo3 :step1 :step2 :div1 :div2 :div :lfnse :sh :freq :period :keynum :gate
:press :vel :cca :ccb :ccc :ccd :a :b :c :d :e :f :g :h :con or :off

Note it is possible to set up feedback paths within the matrix, the exact
behavior of Alias using such configurations has not been explored.

repository: silky/Cadejo

repo_name: silky/Cadejo


text:
<!-- THIS PAGE IS GENERATED. DO NOT EDIT MANUALLY! -->

# Moleculer Database benchmark - Transformation benchmark
This is a transformation benchmark. It tests all service methods with and without transformation.
## Entity creation

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 55μs | 0% | 18,168.9 |
| With transform | 52μs | 4.99% | 19,076.02 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20creation%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform&chd=a%3A18168.900293367842%2C19076.019228229965)

## Entity listing

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 131μs | 0% | 7,591.59 |
| With transform | 148μs | -11.38% | 6,727.93 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20listing%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform&chd=a%3A7591.591553195681%2C6727.932672707071)

## Entity counting

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 726μs | 0% | 1,376.87 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20counting%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform&chd=a%3A1376.8735905731837)

## Entity getting

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 21μs | 0% | 46,501.41 |
| With transform | 28μs | -25.63% | 34,581.01 |
| Direct adapter access | 20μs | 7.33% | 49,908.36 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20getting%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform%7CDirect%20adapter%20access&chd=a%3A46501.41142760411%2C34581.00678348184%2C49908.36425056682)

## Entity updating

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 93μs | 0% | 10,694.34 |
| With transform | 99μs | -6.38% | 10,011.73 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20updating%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform&chd=a%3A10694.336321073446%2C10011.729428104494)

## Entity replacing

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 93μs | 0% | 10,662.15 |
| With transform | 100μs | -7.11% | 9,904.25 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20replacing%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform&chd=a%3A10662.152232432549%2C9904.24653682173)

## Entity deleting

### Result

| Adapter config | Time | Diff | ops/sec |
| -------------- | ----:| ----:| -------:|
| Without transform | 51μs | 0% | 19,603.08 |
| With transform | 183μs | -72.15% | 5,459.5 |

![chart](https://image-charts.com/chart?chs=800x450&chtt=Entity%20deleting%7C%28ops%2Fsec%29&chf=b0%2Clg%2C90%2C03a9f4%2C0%2C3f51b5%2C1&chg=0%2C50&chma=0%2C0%2C10%2C10&cht=bvs&chxt=x%2Cy&chxl=0%3A%7CWithout%20transform%7CWith%20transform&chd=a%3A19603.075297822932%2C5459.497019815262)

--------------------
_Generated at 2021-05-10T16:10:04.759Z_

repository: vimalraj-a/database

repo_name: vimalraj-a/database


text:
![alt text](https://github.com/abrusebas1997/Activintine/blob/master/static/images/logoact.png)

Activintine is a website application for users to find activities to do in this Quarantine or whenever they have free time. It has video games, music, recommendations for movies, workout videos, etc.

### Basic Site Walk-through

New users need to sign up for an account. Once a user is logged in they are going to be able to choose one of the activities they would like to do. If the user don't know what activity to choose, they can click on the circle for a random activity.

### Features

* Account creation
* Profile creation with image upload
* Authenticated user can make posts

### Prerequisites

Must have Django 3 and Python 2.7 installed

.To log into admin

```
username: makeschool
email<EMAIL_ADDRESS>password: makeschool
```

### Proposal

(https://github.com/abrusebas1997/Activintine/blob/master/proposals/proposal.md)

### Installing

Project code can be viewed locally by cloning or forking then open with any integrated development environment

To run project in an IDE, run the following in terminal
```
$ python3 manage.py runserver
```

## Built With

* [Django](https://www.djangoproject.com/) - The web framework used
* [Python](https://www.python.org/) - Language
* [HTML](https://en.wikipedia.org/wiki/HTML) - For webpage
* [CSS](https://en.wikipedia.org/wiki/Cascading_Style_Sheets) - To style
* [JavaScript](https://codepen.io/afahim/pen/yeFuh#code-area) - To make the circle effect. Got it from CodePen, but had to change some of the code to make it work

## Django Addons
This project uses the following third party addons

* [rest_framework](https://www.django-rest-framework.org/)

## Deployment

Project is deployed to

## Authors

* Sebastian Abarca - portfolio can be found at:
https://www.makeschool.com/portfolio/abrusebas16

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

From this project I learned how to make JS effects, CSS webkit-keyframes, how to upload pictures as a user.


text:
# Clone Factory

Official Implementation of the [ERC1167 standard](https://eips.ethereum.org/EIPS/eip-1167)
found at
https://github.com/optionality/clone-factory

with _minor_ modifications to pragma and linting support.


text:
## sublime生成snippet工具 ##
- https://github.com/mohamedturki/generator-sublime-snippets
- https://www.npmjs.com/package/convert-snippets-to-vscode
- https://www.npmjs.com/package/node-atomizr
- https://www.npmjs.com/package/convert-atom-snippets-to-vscode

## 相关资源 ##
- https://medium.freecodecamp.org/a-guide-to-preserving-your-wrists-with-sublime-text-snippets-7541662a53f2
- http://sublimetext.info/docs/en/extensibility/snippets.html
- http://docs.sublimetext.info/en/latest/extensibility/snippets.html
- https://snippets.now.sh/

## vscode ##
- [Creating your own snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets)
- https://blog.csdn.net/maokelong95/article/details/54379046
- https://github.com/pawelgrzybek/snippet-generator
- [How to add custom code snippets in VSCode? https://stackoverflow.com/questions/29995863/how-to-add-custom-code-snippets-in-vscode](https://stackoverflow.com/questions/29995863/how-to-add-custom-code-snippets-in-vscode)
- [Visual Studio Code智能提示](https://github.com/zhenglibao/FlexLib/wiki/Visual-Studio-Code%E6%99%BA%E8%83%BD%E6%8F%90%E7%A4%BA)

repository: huixisheng/x-snippets

repo_name: huixisheng/x-snippets


text:
# [oneup-chat](http://oneup-chat.herokuapp.com/)
Live chat app with node.js and socket.io

Sample NodeJS/Express application demonstrating the use of Socket.IO. I am using:

* [NodeJs](https://nodejs.org/en/)
* [Express](https://expressjs.com/)
* [Socket.io](http://socket.io/)
* [Twitter Bootstrap](https://getbootstrap.com)

This project was a simple test of sockets as a traditional chat program.

### How to run locally
1. Clone the repository
2. Run `npm install` to install required dependecies
3. Run `npm start` to start the server
4. Open a browser and navigate to [locahost:3000](http://localhost:3000)

### Live Demo
You can view a running copy of this app, deployed on heroku at: [oneup-chat.herokuapp.com](https://oneup-chat.herokuapp.com)

### More to come
- [x] Unique color per user
- [x] User connected/disconnected message
- [ ] Private rooms / chats
- [ ] Message history (maybe up to 100 messages?)
- [ ] Add emojis
- [ ] Alert sound for new messages

Enjoy!.

repository: ThPadelis/oneup-chat

repo_name: ThPadelis/oneup-chat


text:
# Building the Graph-ICS Documentation

**NOTE: To this date the documentation is still empty!**

## Doxygen Sphinx Breathe pipeline

The Documentation consists of three steps.

1. Extracting API Documentation from the source code using [Doxygen](https://www.doxygen.nl/index.html).
2. [Sphinx](https://www.sphinx-doc.org/en/master/) (hand-written) Documentation configuration.
3. Using the Sphinx extension [Breathe](https://breathe.readthedocs.io/en/latest/) to get the Doxygen output inside Sphinx.

## How to Build the documentation

### Dependencies

- [Doxygen](https://www.doxygen.nl/download.html)
- [Python](https://www.python.org/downloads/) (greater 3.6)
- You can check your python installation using

```sh
python --version
```

- Sphinx

```sh
pip install sphinx
```

- Sphinx ReadTheDocs Theme

```sh
pip install sphinx-rtd-theme
```

- Breathe

```sh
pip install breathe
```

**Note:** On Windows make sure that your python scripts folder is added to PATH (e.g. C:\Users\graphics\AppData\Roaming\Python\Python39\Scripts)

Now you just need to enable the CMake cache variable GRAPHICS_BUILD_DOCUMENTATION using the CMake GUI or editing the CMakeCache.txt in the build directory.

repository: Graph-ICS/Graph-ICS

gha_language: QML

repo_name: Graph-ICS/Graph-ICS


text:
Uploading Product Images
--

For each product, you can upload multiple images, rearrange their order images, and control how each image is used. If you have a large quantity of images to manage, you might prefer to import them as a batch, rather than upload each one individually. To learn more, see Importing Product Images.

If you intend to upload large images for viewing on the Product Details page, you may want to consider setting a maximum pixel size (width and height) and automatically resizing the files prior to upload. We provide an option to enable automatic resizing of significantly larger image files as you upload. To learn more, see Resizing Product Images.

## To manage images:

1.	Open the product in edit mode.
2.	To work with a specific store view, set the **Store View** chooser in the upper-left corner to the applicable view.
3.	Scroll down and expand the Images and Videos section. Then, do any of the following:

### Upload an Image

To upload an image, do one of the following:

 * Drag an image from your desktop, and drop it on the camera ( ![](https://docs.magento.com/m2/ce/user_guide/Resources/Images/btn-camera_22x18.png) ) tile in the Images box.
In the Images box, tap the camera ( ![](https://docs.magento.com/m2/ce/user_guide/Resources/Images/btn-camera_22x18.png) ) tile, and navigate to the image file on your computer. Then, select the image, and tap  `Open` .

![Upload or Drag and Drop](https://docs.magento.com/m2/ce/user_guide/Resources/Images/product-images-and-video-jewel-tee_thumb_0_0.png)

### Rearrange Images
To change the order of images in the gallery, tap the Sort ( ![](https://docs.magento.com/m2/ce/user_guide/Resources/Images/btn-sort2_19x18.png) ) icon at the bottom of the image tile. Then, drag the image to a different position in the Images box.

![Change Order](https://docs.magento.com/m2/ce/user_guide/Resources/Images/product-images-and-videos-drag_thumb_0_0.png)

### Delete an Image
To remove an image from the gallery, tap the Delete ( ![](https://docs.magento.com/m2/ce/user_guide/Resources/Images/btn-delete_22x18.png) ) icon in the upper-right corner of the image tile.  Then, tap `Save`.

4.	Tap the image that you want to open in detail view: Then, do any of the following:

![Image Detail View](https://docs.magento.com/m2/ce/user_guide/Resources/Images/product-image-detail-jewel-tee_thumb_0_0.png)

### Enter Alt Text

Image Alt text is referenced by screen readers to improve web accessibility, and by search engines when indexing the site. Some browsers display the Alt text on mouseover. Alt text can be several words long, and include carefully selected key words.

In the Alt Text box, enter a brief description of the image.

### Assign Roles

By default, all roles are assigned to the first image that is uploaded to the product. To reassign a role to another image, do the following:

1.	Tap an image tile to open the image in detail view.
2.	In the Role box, choose the role that you want to assign to the image.

  When you return to the Images and Videos section, the currently assigned roles appear below each image.

![Assigned Roles](https://docs.magento.com/m2/ce/user_guide/Resources/Images/product-images-video-swatch_thumb_0_0.png)

### Hide Image
To exclude an image from the thumbnail gallery, mark the Hidden checkbox. Then, tap  `Save` .

![Hidden Images](https://docs.magento.com/m2/ce/user_guide/Resources/Images/product-images-and-videos-hidden_thumb_0_0.png)

5.	To close detail view, click the Close ( ![](https://docs.magento.com/m2/ce/user_guide/Resources/Images/btn-close_22x18.png) ) box in the upper-right corner.
6.	When complete, tap  `Save`

#### Image Roles

IMAGE ROLE | DESCRIPTION
-- | --
Thumbnail| Thumbnail images appear in the thumbnail gallery, shopping cart, and in some blocks such as Related Items. Example size: 50 x 50 pixels
Small Image | The small image is used for the product images in listings on category and search results pages, and to display the product images needed for sections such as for Up-sells, Cross-sells, and the New Products List. Example size: 470 x 470 pixels
Base Image | The base image is the main image on the product detail page. Image zoom is activated if you upload an image that is larger image than the image container. Depending on the level of zoom that you want to achieve, the base image should be two or three times the size of the container. Example sizes: 470 x 470 pixels (without Zoom); 1100 x 1100 pixels (with Zoom)
Swatch | A swatch can be used to illustrate the color, pattern, or texture. Example size: 50 x 50 pixels

repository: merchantprotocol/docs

repo_name: merchantprotocol/docs