Skip to content

Instantly share code, notes, and snippets.

View joeljerushan's full-sized avatar
🟢
ETA 10 million LKR in 2024

Joel Jerushan joeljerushan

🟢
ETA 10 million LKR in 2024
View GitHub Profile
@joeljerushan
joeljerushan / index.html
Created April 24, 2024 11:41
Sample HTML for learning
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
<style>
.amma {
display: flex;
flex-direction: column;
@joeljerushan
joeljerushan / .deps...npm...hardhat...console.sol
Created March 2, 2024 02:12
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.22+commit.4fc1097e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS =
0x000000000000000000636F6e736F6c652e6c6f67;
function _sendLogPayloadImplementation(bytes memory payload) internal view {
address consoleAddress = CONSOLE_ADDRESS;
/// @solidity memory-safe-assembly
@joeljerushan
joeljerushan / com.googlecode.iterm2.plist
Created June 25, 2023 01:44
com.googlecode.iterm2.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
@joeljerushan
joeljerushan / react_developers.text
Last active May 27, 2022 06:10
React Task for Developers
Hope you guys are ready to finish this small task.
Tasks
01 - Using create-react-app create react application.
02 - Create two fields in App.js file with following information
Field 01 - Name input
Field 02 - Age Input
Button 03 - Submit Button
03 - When user submit the Button, it should create a file inside `public/user/`, pick supported file type to read it.
04 - Create another Button called Read Data. When click Read Data Button it should read the file created at `task 03`
@joeljerushan
joeljerushan / solanaPay.js
Created March 20, 2022 01:15
Solana Pay Module for Siva App
import React, { Component } from 'react'
import { InputGroup, Button, FormControl, Row, Col, Modal } from 'react-bootstrap'
import { addDoc, collection, serverTimestamp } from "firebase/firestore";
import { getAuth, onAuthStateChanged } from "firebase/auth";
import { db } from '../../../../Firebase'
import { Cluster, clusterApiUrl, Connection, PublicKey, Keypair, LAMPORTS_PER_SOL, } from '@solana/web3.js';
@joeljerushan
joeljerushan / image_upload_firebase.js
Last active April 13, 2021 03:58
Firebase Image Upload with ImageUpload React
putFeaturedImagetoStorage(key){
// the return value will be a Promise
let set = this
let time = Date.now();
let name = '/FOLDER_NAME/' + 'featured-' + time
return firebase.storage().ref().child(name).put(set.state.featured_image[0]).then(function(snapshot) {
snapshot.ref.getDownloadURL().then(function(downloadURL) {
let imagePath = {
@joeljerushan
joeljerushan / PaginateApp.js
Last active April 13, 2024 06:11
React Pagination with Firebase FireStore - (Prev / Next Pagination)
import React, { useState, useEffect } from 'react'
//i'm using react-bootstrap for UI elements
import { Table, Button, ButtonGroup } from "react-bootstrap";
//firebase config
import firebase from './../../Firebase'
export default function App() {
const [list, setList] = useState([]);
const [page, setPage] = useState(1);
@joeljerushan
joeljerushan / 01 - Registration of PCR
Last active December 19, 2020 05:38
PCR Registration Payload
let data = {
"trackedEntityType": "SXtGAk7eCxX",
"orgUnit": set.props.org,
"attributes": [
{ "attribute": "gvP9uZqEtM5", "value": set.state.name },
{ "attribute": "DDleOZ1LGAq", "value": set.state.gender },
{ "attribute": "Js9Vbj0osNl", "value": set.state.age },
{ "attribute": "pNOTaJeFbPo", "value": set.state.address },
{ "attribute": "GO2w5l0aFjl", "value": set.props.moh },
{ "attribute": "ihz1qXLws99", "value": set.state.telephone },
@joeljerushan
joeljerushan / app.js
Created June 18, 2019 03:30
GooglePlacesAutocomplete, google map api autocomplete address_components into one object - react native way
getPlaceInfo() {
//setting address_components from GooglePlacesAutocomplete Return
let place = this.state.address_components
//creating object for namespaces from GooglePlacesAutocomplete
var place_info = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
@joeljerushan
joeljerushan / selected.php
Last active April 30, 2021 17:02
Set Selected with PHP without Javascript - Adding “selected” attribute to the selected option in PHP
<select>
<?php
//init array with key value pairs
$purchase_type = array(
'1' => 'White Rice',
'2' => 'Red Rice',
'3' => 'Wheat',
'4' => 'Packets',
'5' => 'Firewood'
);