Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'm happy these days.

Sahil Rajput sahilrajput03

💭
I'm happy these days.
View GitHub Profile
@sahilrajput03
sahilrajput03 / index.html
Last active Aug 4, 2022
rpc-demo snippet FRONTEND
View index.html
<!-- File: index.html -->
<!-- In <body> of you html, you can use rpc like that -->
<div class="desc">Use below buttons to call appropriate function on server:</div>
<button onclick="btn1()">rpc.test()</button>
<button onclick="btn2()">rpc.yoy("God loves all")</button>
<button onclick="btn3()">rpc.cat({say: "meoww"})</button>
<button onclick="btn4()">rpc.love("donald", "pikachu")</button>
<button onclick="btn5()">rpc.someNonExistingFunction("pokemons")</button>
<button onclick="btn6()">rpc.rain("Charlizard", "Nobita")</button>
View server-functions.js
// File: server-functions.js
module.exports.test = () => 'works!'
module.exports.yoy = (message) => {
return message + ' from server..'
}
module.exports.cat = (body) => {
const {say} = body
return 'Cat says:' + say + '!!'
}
module.exports.love = (name1, name2) => {
View dummyDataDogs.txt
[
{
"breed": "Affenpinscher",
"origin": "Germany",
"url": "https://en.wikipedia.org/wiki/Affenpinscher",
"img": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Affenpinscher.jpg/220px-Affenpinscher.jpg",
"meta": {
"height": "23–30 cm (9–12 in)",
"weight": "3–6 kg (7–13 lb)",
"coat": "Wire",
View magna.php.log.sh
array@array-os:~/test/magnaluna$ php magna.php
PHP Warning: PHP Startup: php-libtgvoip: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20190902
These options need to match
in Unknown on line 0
Deserializing MadelineProto from session.madeline...
Logger: MadelineProto
Logger: Copyright (C) 2016-2020 Daniil Gentili
Logger: Licensed under AGPLv3
@sahilrajput03
sahilrajput03 / forking crazy- crazed!!.html
Last active Jun 26, 2021
#cssbattle.dev #Solved - 25 june, 2021, Battle #1 - Pilot Battle - Forking Crazy
View forking crazy- crazed!!.html
<div class='c c1'></div>
<div class='c c2'></div>
<div class='c c3'></div>
<div class='c c4'></div>
<div class='sky-blue-upside-down-strip s1'></div>
<div class='sky-blue-upside-down-strip s2'></div>
<div class='sky-blue-upside-down-strip s3'></div>
<div class='fork-upper-rectangle'></div>
View trying.js
console.log()
console.log()
console.log()
console.log()
console.log()
console.log()
console.log()
console.log()
console.log()
console.log()
@sahilrajput03
sahilrajput03 / useStore.js
Created Nov 11, 2020
#useStoreExample #useStore
View useStore.js
/* eslint-disable no-unused-vars */
import React from 'react';
import './styles.css';
import {useStore} from './useStore';
let log = console.log;
export default function App() {
const [home, setHome] = useStore('home', 10);
const [kitchen, setKitchen] = useStore('kitchen', 200);