Skip to content

Instantly share code, notes, and snippets.

View sidward35's full-sized avatar

Siddharth Mathur sidward35

View GitHub Profile
@sidward35
sidward35 / index.html
Created June 6, 2019 15:41
Horizontal scrolling text in HTML
<marquee behavior="scroll" bgcolor="yellow" loop="-1" width="30%">
<i>
<font color="blue">
Today's date is :
<strong>
<span id="time"></span>
</strong>
</font>
</i>
</marquee>
@sidward35
sidward35 / file_sort.bat
Created January 9, 2019 07:58
Batch script that sorts files into folders by file type
@echo off
rem For each file in your folder
for %%a in (".\*") do (
rem check if the file has an extension and if it is not our script
if "%%~xa" NEQ "" if "%%~dpxa" NEQ "%~dpx0" (
rem check if extension folder exists, if not it is created
if not exist "%%~xa" mkdir "%%~xa"
rem Move the file to directory
move "%%a" "%%~dpa%%~xa\"
@sidward35
sidward35 / remove_bloat.bat
Last active March 17, 2020 20:57
Remove OEM Bloatware From S8
@echo off
title S8 Bloatware Remove Tool
echo This script will remove all OEM bloatware from your S8.
pause
cls
adb shell
pm uninstall -k --user 0 com.samsung.svoice.sync
@sidward35
sidward35 / FolderLocker.bat
Created August 11, 2018 09:36
Batch file that creates a locker folder that can only be unlocked with password, as defined on line 23
cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
@sidward35
sidward35 / MainActivity.java
Created March 27, 2018 10:41
Android get data from Firebase realtime database and add it as CardView
private DatabaseReference mDatabase;
@Override
protected void onCreate(Bundle savedInstanceState) { //closes on line 74
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_available_donations);
final Context mContext = getApplicationContext();
mDatabase = FirebaseDatabase.getInstance().getReference();
@sidward35
sidward35 / MainActivity.java
Created March 27, 2018 10:30
Android upload data to Firebase realtime database
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donations_details_entry);
edtQuantity = (EditText)findViewById(R.id.edt_quantity);
edtAddress = (EditText)findViewById(R.id.edt_address);
edtFood = (EditText)findViewById(R.id.edt_food);
edtPhone = (EditText)findViewById(R.id.edt_phone);
@sidward35
sidward35 / MainActivity.java
Last active March 27, 2018 10:28
Android programmatically restart app
Intent i = getBaseContext().getPackageManager()
.getLaunchIntentForPackage( getBaseContext().getPackageName() );
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
@sidward35
sidward35 / OrangePiWiFiSetup.md
Created February 20, 2018 23:35
OrangePi WiFi Configuration Guide

Initial configuration

Now that the Orange Pi Zero is working, we can do some initial set up. The following assumes you are logged into your Orange Pi Zero using either SSH or the serial console with your everyday account. Remember to hit the enter key after typing in each line of commands.

First we’ll update Armbian to the latest version:

sudo apt-get update
sudo apt-get upgrade
@sidward35
sidward35 / PrintDates.java
Created January 3, 2018 08:33
Print all the dates of 2018 in yyyy-mm-dd format
//Super inefficient, quick-hacks hardcoded method!!
for(int x=1; x<=12; x++){
if(x==1||x==3||x==5||x==7||x==8||x==10||x==12){
for(int y=1; y<=31; y++){
if(x<10 && y<10) System.out.printf("2018-0%1d-0%1d\n", x, y);
else if (x<10 && y>9) System.out.printf("2018-0%1d-%2d\n", x, y);
else if (x>9 && y<10) System.out.printf("2018-%2d-0%1d\n", x, y);
else if (x>9 && y>9) System.out.printf("2018-%2d-%2d\n", x, y);
}
}else if(x==2){
@sidward35
sidward35 / DigiKeyboard.h
Created July 27, 2017 03:34
Digispark USB Keyboard & Mouse
/*
* Based on Obdev's AVRUSB code and under the same license.
*
* TODO: Make a proper file header. :-)
* Modified for Digispark by Digistump
*/
#ifndef __DigiKeyboard_h__
#define __DigiKeyboard_h__
#include <Arduino.h>