Skip to content

Instantly share code, notes, and snippets.

View CloudyPadmal's full-sized avatar
🧰
Making PSLab great ...

Padmal CloudyPadmal

🧰
Making PSLab great ...
View GitHub Profile
"[latex]": {
"editor.formatOnPaste": false,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.defaultFormatter": "James-Yu.latex-workshop"
},
"latex-workshop.latex.autoBuild.run": "onSave",
"latex-workshop.latex.autoClean.run": "onBuilt",
"latex-workshop.latex.recipes": [
{
"name": "latexmk",
@CloudyPadmal
CloudyPadmal / latex-vscode.json
Created October 15, 2023 18:29
Style sheet for LaTeX workshop -- Add this set to settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"support.function.general.tex",
"support.function.textit.latex",
"support.function.texttt.latex",
"support.function.textbf.latex",
"support.function.textsc.latex",
"support.function.url.latex",
@CloudyPadmal
CloudyPadmal / image-diff.sh
Created February 10, 2022 12:36
Bash script to view the difference between two images.
#!/bin/bash
IMG1=${1};
IMG2=${2};
convert -colorspace gray -density 300 $IMG1 t1.jpg
convert -colorspace gray -density 300 $IMG2 t2.jpg
composite -stereo 0 t1.jpg t2.jpg RESULT.jpg
@CloudyPadmal
CloudyPadmal / DS1307-RTC.py
Created October 25, 2021 12:38
DS1307 Real Time Clock I2C module time setting and fetching using Python
def DS1307_Set_Time():
from datetime import datetime
now=datetime.now()
seconds = int(now.second)
sec_1 = '{0:04b}'.format(seconds % 10)
sec_2 = '{0:04b}'.format(int(seconds / 10))
b_seconds = sec_2 + sec_1
minutes = int(now.minute)
table = [256, 252, 249, 246, 243, 240, 237, 234, 230, 227, 224, 221, 218, 215, 212, \
209, 206, 203, 200, 196, 193, 190, 187, 184, 181, 178, 175, 172, 169, 166, \
164, 161, 158, 155, 152, 149, 146, 143, 141, 138, 135, 132, 130, 127, 124, \
121, 119, 116, 114, 111, 108, 106, 103, 101, 98, 96, 93, 91, 89, 86, 84, 82, \
79, 77, 75, 73, 70, 68, 66, 64, 62, 60, 58, 56, 54, 52, 50, 48, 47, 45, 43, \
41, 40, 38, 36, 35, 33, 32, 30, 29, 27, 26, 25, 23, 22, 21, 19, 18, 17, 16, \
15, 14, 13, 12, 11, 10, 9, 8, 8, 7, 6, 6, 5, 4, 4, 3, 3, 2, 2, 2, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, \
8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, \
30, 32, 33, 35, 36, 38, 40, 41, 43, 45, 47, 48, 50, 52, 54, 56, 58, 60, 62, \
seIconsInMenus=1
IconScale=-1
MousewheelPAN=0
ZoomNoCenter=1
AutoPAN=1
OpenGLAntialiasingMode=0
CairoAntialiasingMode=0
WorkingDir=/home/runner
ShowEnvVarWarningDialog=1
AutoSaveInterval=300
import serial
import time
import struct
import datetime
Byte = struct.Struct("B")
NONSTANDARD_IO = Byte.pack(14)
DS1307 = Byte.pack(4)
s = serial.Serial(port='/dev/ttyUSB0', baudrate=1000000, timeout=0.1)
@CloudyPadmal
CloudyPadmal / loop_timing_analysis.py
Created July 28, 2020 07:19
Compare timing for loop merge operations using different methods
import time
import random
import numpy as np
A = [random.random() for i in range(65536)]
B = [random.random() for i in range(65536)]
C = [random.random() for i in range(65536)]
D = [random.random() for i in range(65536)]
E = [random.random() for i in range(65536)]
F = [random.random() for i in range(65536)]
@CloudyPadmal
CloudyPadmal / dismissible_swipe_both_ways.dart
Last active April 22, 2022 12:34
Dismissible Swipe view for two actions
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Dismissible',
theme: ThemeData(
@CloudyPadmal
CloudyPadmal / GSoC18-Padmal.md
Created August 6, 2018 21:33
GSoC 2018 - Final Submission - Padmal

Google Summer of Code 2018 - Padmal

Starting from 14th of May 2018, I was a Google Summer of Code participant with PSLab organization. During this summer I was working on an Android project and a Python project making improvements to the existing user interfaces for PSLab device.

PSLab by FOSSASIA integrates commonly used electronic equipments such as Oscilloscope, Signal Generator, Logic Analyzer in a lab and even a connectivity to common I2C sensors into a pocket sized device using a PIC micro-controller. The functionalities can be accessed using a desktop application or an Android application.

The project consisted of multiple repositories which I had to work on. PSLab Android, PSLab Python, PSLab Artwork, PSLab Experiments and PSLab Hardware. The major outcome of the project was to improve the Android application. During the first month, I was helping with team building as this was my second time participating in this project so fellow developers would get a better insight into the project and it