Skip to content

Instantly share code, notes, and snippets.

View yhdesai's full-sized avatar
💻
Shipping

Yash Desai yhdesai

💻
Shipping
View GitHub Profile
#!/bin/bash
# User Check
if [ "$USER" = 'root' ]
then
gdialog --title "User Check" --msgbox "User is root, you can execute the script successfully." 200 150
echo "User is root, you can execute the script successfully"
else
gdialog --title "User Check" --msgbox "User is not Root. Please run the script as root user." 200 150
@yhdesai
yhdesai / tracking.js
Created November 12, 2018 02:31
tracking js
<!--Script code can be put in the bottom of the page, wait until the page is loaded then execute.-->
<script type="text/javascript" src="//www.17track.net/externalcall.js"></script>
<script type="text/javascript">
function doTrack() {
var num = document.getElementById("YQNum").value;
if(num===""){
alert("Enter your number.");
return;
}
<!--Tracking number input box.-->
<input type="text" id="YQNum" maxlength="50"/>
<!--The button is used to call script method.-->
<input type="button" value="TRACK" onclick="doTrack()"/>
<!--Container to display the tracking result.-->
<div id="YQContainer"></div>
@yhdesai
yhdesai / Prosthetic Hand
Last active April 10, 2018 15:11
Prosthetic Hand Code (Required by Omprakash)
//This code is for Prosthetic Hand by Arduino using Muscle Sensor as Input and Servo Motor as Output
//Written by Yash on 10/04/2018
//Contact me at [email protected]
#include <Servo.h>
//Setting the Value for the Servo Output
int servo1 = x;
//Setting the Value for the Muscle Sensor Input
#include <ESP8266WiFi.h>
const char* ssid = "HT";
const char* password = "123456789";
int tb = 13; // GPIO13
int fan = 12; // GPIO12
int led = 14; // GPIO14
int tube = 5; //GPIO5
int ll = 4; //GPIO4
@yhdesai
yhdesai / message.xml
Created February 26, 2018 12:23
message view
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:orientation="vertical">
<ImageView
android:id="@+id/photoImageView"
@yhdesai
yhdesai / input.xml
Created February 26, 2018 12:20
the input layout
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:orientation="horizontal">
<ImageButton
import time #Importing the time library to check the time of code execution
import sys #Importing the System Library
import os
import requests
#import urllib2
import discord
client = discord.Client()
@client.event
@yhdesai
yhdesai / NodeMCU_LED_ON_OFF.ino
Created September 16, 2017 12:38 — forked from sdrshnptl/NodeMCU_LED_ON_OFF.ino
Toggle LED from NodeMCU using WIFI.
/*
open browser and hit
192.168.1.167/?1 to ON
192.168.1.167/?0 to OFF
*/
#include <ESP8266WiFi.h>
{
"id": "ec078e30-f2e6-4f0d-9fc8-4f2a2ce89851",
"timestamp": "2017-09-15T09:27:59.441Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "turn the light on",
"action": "smarthome.lights.switch.on",
"actionIncomplete": false,
"parameters": {