Skip to content

Instantly share code, notes, and snippets.

View TheAlchemistKE's full-sized avatar
🤩
Always Be Coding, Always Be Learning

Kelyn Paul Njeri TheAlchemistKE

🤩
Always Be Coding, Always Be Learning
View GitHub Profile
package com.musicalcoder.inspireme.network;
import com.musicalcoder.inspireme.model.User;
import com.musicalcoder.inspireme.model.UserResponse;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface Service {
@TheAlchemistKE
TheAlchemistKE / test.py
Last active April 24, 2019 10:48
Convertion of Letters in text into their corresponding positions in the alphabet.
def test_letter_to_numeral_convertion(plain_text=None):
for i, letter in enumerate(plain_text):
if i < len(plain_text):
numeral = ord(letter) - 96
print(i, numeral)
test_letter_to_numeral_convertion(plain_text="Lenny")
@TheAlchemistKE
TheAlchemistKE / HomeScreen.java
Created July 4, 2019 09:31
This is the Activity to which I show all my images.
package com.kelynnjeri.memories;
import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
package com.kelynnjeri.memories;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
package com.kelynnjeri.memories;
/**
* Created by Kelyn Njeri on 7/1/19.
**/
public class Uploads {
String imageUrl;
public Uploads() {
//Empty Constructor.
package com.example.alc4phase1;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
version: '2'
services:
db:
image: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'db',
'PORT': 5432,
}
}
class User < ApplicationRecord
has_secure_password
has_many :created_events, foreign_key: :creator_id, class_name: 'Event'
has_many :user_events, foreign_key: :attendee_id
has_many :events_attended, through: :user_events, dependent: :delete_all, source: :event_attended
end