Skip to content

Instantly share code, notes, and snippets.

View yhdesai's full-sized avatar
💻
Shipping

Yash Desai yhdesai

💻
Shipping
View GitHub Profile
@yhdesai
yhdesai / index.html
Created December 1, 2021 12:03
The Flying Robot (Pure CSS Drawing/Animation) [codepen challenge]
<div class="container">
<div class="spaceship">
<div id="star1"></div>
<div id="star2"></div>
<div id="star3"></div>
<div class="robot">
<div id="half">
<div id="brain"></div>
</div>
<div id="head">
@yhdesai
yhdesai / git_graph.php
Created September 30, 2021 08:46 — forked from levelsio/git_graph.php
GitHub style graph in PHP + CSS
<style>
.git-graph {
text-align: left;
line-height: 1;
}
.git-graph-row {
clear: both;
text-align: left;
}
.git-graph-cell {
//If functional component, const [cityData, setCityData] = useState[]
//Firebase, Getting a single document
var docRef = db.collection("cities").doc("SF");
docRef.get().then((doc) => {
if (doc.exists) {
console.log("Document data:", doc.data());
this.setState({cityData: doc.data()}); //OR(if functional component) setCityData(doc.data());
} else {
Machine Information
-------------------
Disks: {"sda"=>{"model"=>"PersistentDisk", "size"=>"10.00 GiB", "size_bytes"=>10737418240, "vendor"=>"Google"}}
Memory: {"system"=>{"available"=>"3.23 GiB", "available_bytes"=>3471638528, "capacity"=>"10.12%", "total"=>"3.60 GiB", "total_bytes"=>3862577152, "used"=>"372.83 MiB", "used_bytes"=>390938624}}
Processors: {"count"=>1, "isa"=>"x86_64", "models"=>["Intel(R) Xeon(R) CPU @ 2.30GHz"], "physicalcount"=>1}
Network Interfaces: ens4,lo
}
@yhdesai
yhdesai / indexhtr
Created October 1, 2019 10:18
test
alert('hi');
@yhdesai
yhdesai / jajoosam-share-skrrt-css-fix-in-js-by-yhdesai.js
Created September 9, 2019 17:53
jajoosam share skrrt css fix by js :P
var main = document.getElementsByTagName("main")[0];
main.outerHTML = main.outerHTML.replace(/main/g,"div");
var wave = document.getElementsByTagName("wave")[0];
wave.style.overflow="";
@yhdesai
yhdesai / Attempt 1
Last active September 5, 2019 17:57
Attempt 1 : worked great until around 2000 but then started giving I/O errors, probably cause the delay between two tab open was very low
{
"0": {
"tabs": 0,
"Memory": {
"totalMem": 8224706560,
"freeMem": 5601857536,
"usedMem": 2622849024
}
@yhdesai
yhdesai / index.js
Last active September 5, 2019 11:47
Medium Bookmark List Export
var links = [];
var ele = document.getElementsByClassName("link");
for(var i=0, len=ele.length; i<len; i++)
{
links.push(ele[i].href);
}
function setBody(){
@yhdesai
yhdesai / index.js
Created April 1, 2019 13:40
Cloud Vision API NodeJS Sample
async function quickstart() {
const vision = require('@google-cloud/vision');
const client = new vision.ImageAnnotatorClient();
const fileName = 'hindi.png'
// Read a local image as a text document
const [result] = await client.documentTextDetection(fileName);
# Python Program to find the L.C.M. of two input number
# define a function
def lcm(x, y):
"""This function takes two
integers and returns the L.C.M."""
# choose the greater number
if x > y:
greater = x