Skip to content

Instantly share code, notes, and snippets.

View Yazan98's full-sized avatar
💻
Doing Android Things

Yazan Tarifi Yazan98

💻
Doing Android Things
View GitHub Profile
@Yazan98
Yazan98 / MessagingManager.ts
Created October 20, 2021 23:36
Send Slack Message in NestJs
private static sendSlackMessage(configFile: ApplicationConfigFile, message: string) {
try {
MessagingManager.getSlackApplicationInstance(configFile.signingSecret, configFile.token).client.chat.postMessage({
channel: configFile.channelId,
mrkdwn: true,
text: message,
as_user: true,
parse: "full",
username: "Zilon"
}).then((response) => {
@Yazan98
Yazan98 / GithubDependenciesManager.ts
Created October 20, 2021 23:30
Send Github Api Request to Validate Library Releases
export class GithubDependenciesManager {
private static GITHUB_LIBRARIES_FILE = "github-libraries.json";
private static CONSOLE_LOGGING_KEY = "[Github Dependencies Manager]";
private static GITHUB_CACHE_FILE = "github-libraries-cache.json";
private static CONFIG_FILE = "config.json";
/**
* Main Method to Start inside This Manager
* 1. Create and Validate the Local Json Files
@Yazan98
Yazan98 / NetworkInstance.ts
Created October 20, 2021 23:22
Github Api V3 with Axios
import axios, { Axios } from "axios";
export class NetworkInstance {
public static SUCCESS_RESPONSE_CODE = 200;
// General Url's For Requests
public static GROUP_ARTIFACTS = "/group-index.xml";
public static GITHUB_REPOS_KEY = "/repos/";
public static GITHUB_RELEASES_KEY = "/git/refs/tags";
@Yazan98
Yazan98 / TasksService.ts
Last active October 20, 2021 23:19
Cron Job Scheduler in NestJs
import { Injectable } from "@nestjs/common";
import { Cron, CronExpression } from "@nestjs/schedule";
@Injectable()
export class TasksService {
@Cron(CronExpression.EVERY_DAY_AT_1AM, {
name: "dependencies"
})
handleCron() {
@Yazan98
Yazan98 / commands
Last active October 20, 2021 23:33
Generate NestJs Application Commands in Terminal
npm install -g @nestjs/cli
npx nest new project-name
cd project-name
npm install --save @nestjs/schedule
npm install --save-dev @types/cron
npm install axios
npm install @slack/bolt
@Yazan98
Yazan98 / manifest.yaml
Created October 16, 2021 15:52
Slack Application (Manifest Configuration)
_metadata:
major_version: 1
minor_version: 1
display_information:
name: Zilon
features:
app_home:
home_tab_enabled: true
messages_tab_enabled: true
messages_tab_read_only_enabled: false
@Yazan98
Yazan98 / items.json
Last active February 4, 2021 19:40
Palex Daily Wallpapers
{
"items": [
"https://images.unsplash.com/photo-1549740425-5e9ed4d8cd34?ixlib=rb-1.2.1&ixi=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1350&q=80",
"https://images.unsplash.com/photo-1525919646094-d07bd618cd93?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1400&q=80",
"https://images.unsplash.com/photo-1482784160316-6eb046863ece?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
"https://images.unsplash.com/photo-1506404523803-9f9fa45e066e?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
"https://images.unsplash.com/photo-1495012379376-194a416fcc5f?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=667&q=80",
"https://images.unsplash.com/photo-1504714071067-f2880fba258a?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=675&q=
@Yazan98
Yazan98 / Pull Request Template
Created May 6, 2020 03:46
Pull Request Template For any Git Changes
<!--- Provide a general summary of your changes in the Title above -->
<!--- If there is no changelog entry, label this PR as trivial to bypass the Danger warning -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
@Yazan98
Yazan98 / Java Module Bintray Configuration
Created January 31, 2020 09:57
Java Module Bintray Upload Configuration (SpringBoot, Android Java Module)
def artifactID = "vortex-spring-boot"
def rootDes = "Vortex SpringBoot is the Base Code TO Build Better Backend Projects"
def repoName = "Vortex-SptingBoot"
version = "1.0.3"
group = "io.vortex"
ext {
LibraryGroup = "io.vortex"
@Yazan98
Yazan98 / Work Manager
Created January 27, 2020 10:48
Send Api Request Via Worker
class OffersWorker @Inject constructor(context: Context, workerParams: WorkerParameters) : CoroutineWorker(context, workerParams) {
private val notificationsRepository: NotificationRepository by lazy {
NotificationRepository()
}
override suspend fun doWork(): Result = coroutineScope {
notificationsRepository.getService()
.sendOffer(OfferBody("From Work Manager", "The Schedual Each Second"))