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 / fetch_sample.php
Created July 21, 2017 02:53
sample fetch i created for now
<?php
include_once 'connection.php';
$price = new database();
$get_type_1 = "SELECT * from 01_premium_poster_230_matt";
$get_type_1_fetch = $price->get($get_type_1);
$get_type_2 = "SELECT * from 02_premium_poster_260_semi_gloss";
$get_type_2_fetch = $price->get($get_type_2);
@joeljerushan
joeljerushan / gist:3bab1afc775d71034b4bab26f5ecfb9d
Created September 10, 2017 13:04
Wamp Fix VCRUNTIME140.dll by JellRose
01 - Download and install this first - https://www.microsoft.com/en-us/download/confirmation.aspx?id=15336
02 - Second - https://www.microsoft.com/en-us/download/details.aspx?id=30679
03 - Third - https://www.microsoft.com/en-us/download/details.aspx?id=48145
04 - fourth - http://windows.php.net/downloads/qa/php-7.2.0RC1-Win32-VC15-x86.zip
@joeljerushan
joeljerushan / index.php
Created March 30, 2018 12:56
Set Selected with PHP without Javascript
<select>
<?php
//init array with key value pairs
$purchase_type = array(
'1' => 'White Rice',
'2' => 'Red Rice',
'3' => 'Wheat',
'4' => 'Packets',
'5' => 'Firewood'
);
@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'
);
@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 / 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 / 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 / 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 / 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 / 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`