Skip to content

Instantly share code, notes, and snippets.

View sumanssaurabh's full-sized avatar
🏠
Working from home

Suman Saurabh sumanssaurabh

🏠
Working from home
View GitHub Profile
@sumanssaurabh
sumanssaurabh / Git basic cheatsheet
Last active July 29, 2018 09:55
Git basic cheatsheet
#Basic commands
git init //Initalize Local Git Repository
git add <file> //Add Files to index
git status //check status of working tree
git commit //commit changes in index
#remote commands
git push //push to remote Repository
git pull //pull latest from remote Repository
git clone //clone Repository into new directory
@sumanssaurabh
sumanssaurabh / rfcomm.service
Last active March 31, 2019 22:25
RFCOMM service with job control, ioctl for rpi 3b/b+ ,serial line comm over bluetooth
[Unit]
Description=RFCOMM service
After=bluetooth.service
Requires=bluetooth.service
[Service]
ExecStartPre=/usr/bin/sdptool add --channel=3 SP
ExecStart=/usr/bin/rfcomm watch hci0 3 setsid /sbin/agetty -L rfcomm0 --keep-baud 115200,38400,9600 xterm -a pi
Restart=on-failure
RestartSec=5s
@sumanssaurabh
sumanssaurabh / rpi_conf.sh
Created March 31, 2019 22:21
rpi configuration
#!/bin/bash
#vcgencmd measure_volts <id>
#Shows voltage. id can be one of core, sdram_c, sdram_i, sdram_p, and defaults to core if not specified
for id in core sdram_c sdram_i sdram_p ; do \
echo -e "$id:\t$(vcgencmd measure_volts $id)" ; \
done
#Shows core temperature of BCM2835 SoC.
vcgencmd measure_temp
#or
# Python v3.4.2 console based script
# Set Raspberry Pi GPIO ports Low depending on user input
# User enters number between 0 and 15, GPIO ports 22, 23, 24 & 25
# are set as BCD representations of the decimal input.
# GPIO ports are weighted 0, 2, 4, 8 [GPIO 22, 23, 24, 25]
# Number 99 entered quits the script
# GPIO ports connect to AD8-11 ports on HT12E encoder chip
# user input is BCD coded & used to set AD8-11 ports
# GPIO port 17 is used to send trigger pulse to activate the HT12E for 1 complete cycle
@sumanssaurabh
sumanssaurabh / readme.md
Created March 31, 2019 22:36 — forked from ionurboz/readme.md
Vanilla JS equivalents of jQuery methods

jQuery vs. JavaScript

Events

// jQuery
$(document).ready(function() {
  // code
})
@sumanssaurabh
sumanssaurabh / bobp-python.md
Created March 31, 2019 22:41 — forked from SicHistory/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@sumanssaurabh
sumanssaurabh / Java cheatsheet.md
Created March 31, 2019 22:43 — forked from Adria87/Java cheatsheet.md
[Java cheatsheet] #java
Operation Code
New List List<Integer> x = new ArrayList<Integer>();
Copy List List<Integer> x = new ArrayList<Integer>(y);
Add an element to the List x.add(element)
Get an elemenet from the List x.get(index)
Clear the list x.clear()
New HashMap HashMap<Integer, String> x = new HashMap<Integer, String>();
Add element to the map x.put(key, value)
Get an element from the map x.get(key)

Java

Collection of Java & Related Codes,Concepts

##### Java.com
I. Annotations
II.Md5 Hashing
@sumanssaurabh
sumanssaurabh / 00 - Basic.md
Created March 31, 2019 22:46 — forked from amelieykw/00 - Basic.md
[Java Interview Preparation] #java #interview
  1. Java Identifiers
  2. Data types
  3. How to define our own data type in java(enum)
  4. Variables
  5. Scope of Variables
  6. Loops in Java(Practice)
  7. For-each loop in Java
  8. For Loop in Java | Important points
  9. Decision Making(if, if-else, switch, break, continue, jump)(Practice)
  10. Switch Statement in Java(Practice)
@sumanssaurabh
sumanssaurabh / Java conventions.md
Created March 31, 2019 22:47 — forked from Adria87/Java conventions.md
[Java conventions] #java

Coding Conventions

This file will cover important coding practices that are important to stress when coding this program. Listed below are some of the more important details that should be stressed. Each programmer has his/her own way to deliver code. The importance of having similar coding conventions throughout this program are listed below.

  • 80% of the time spent on a piece of software goes to maintenance.
  • Hardly any software is maintained for its whole life by the original author.
  • Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
  • If you ship your source code as a product, you need to make sure it is as well packaged and clean as any other product you create.