Skip to content

Instantly share code, notes, and snippets.

View jestrux's full-sized avatar

WALTER KIMARO jestrux

View GitHub Profile
import { env } from "cloudflare:workers";
import { parse } from "node-html-parser";
async function processWebsite(url: string, content: string) {
const div = parse(content);
const ogImage = div
.querySelector(`[property="og:image"]`)
?.getAttribute("content");
import React from 'react';
class Menu extends React.Component {
static Options = ({ className, children }) => {
return (
<div className={'some-menu-options ' + className}>{ children }</div>
);
}
static Option = ({ className, children, onSelected }) => {
function showNotification(_notification){
let notificationNode = document.createElement('div');
notificationNode.id = _notification.id;
notificationNode.innerText = _notification.message;
wrapper.appendChild(notificationNode);
setTimeout(() => wrapper.removeChild(document.getElementById(_notification.id)), _notification.duration);
}
const notifEvent = (message, options) => {
return new CustomEvent('a-notification', { detail: {message, options} });
}
export const notify = ( message, opts = {} ) => {
const defaultOptions = { duration: 2000, position: 'top' };
const options = { ...defaultOptions, ...opts };
document.dispatchEvent( notifEvent(message, options) );
}
const wrapper = document.createElement('div');
wrapper.classList.add('notifications');
document.body.appendChild(wrapper);
document.addEventListener('a-notification', (e) => {
const { message, options } = e.detail;
const _notification = { message, ...options };
_notification.id = 'a-notif-' + Math.random().toString(36).substr(2, 5);
package com.example.waky.denti;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.StrictMode;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
class ExpertRated extends Notification
{
use Queueable;
private $rating;
private $user;
public function __construct(Rating $rating, User $user)
{
$this->rating = $rating;
<?php
//Follows Schema
//Here is the schema for the follows table
Schema::create('follows', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('followed_id');
$table->timestamps();
});
protected void onCreate(Bundle savedInstanceState) {
File folder = null;
try {
folder = new File(Environment.getExternalStorageDirectory()
+ "/Hymns Kali");
if(audioExist(folder, item_src)){
audio_state = 1;
}
} catch (Exception e) {
e.printStackTrace();