Messages - mouser [ switch to compact view ]

Pages: prev1 ... 11 12 13 14 15 [16] 17 18 19 20 21 ... 7553next
76
Just thought I'd share this little code snippet for a batch (zipcurdir.bat) file that I use quite frequently.
Requires 7-zip but could be adapted for any other zip tool.
Then just put this little .bat file in any directories where you want to be able to super quickly make a uniquely timestamped zip file of the contents of the directory, and then move the zip file out of the way to the parent directory.
I use this all the time when I'm working on a project and it's not under version control and I want to make sure I have quick backups before something goes wrong.

Add any exclusion patterns you want to the extraoptions line, and change 7-zip location if different; or maybe you want to change the destination folder..

for %%a in ("%cd%") do set "CurDir=%%~na"
set thedir=%CurDir%

set mydate=%date:~12,2%%date:~4,2%%date:~7,2%
set TIMEZERO=%TIME: =0%
set HOUR=%TIMEZERO:~0,2%
set MIN=%TIMEZERO:~3,2%
set mytime=%HOUR%%MIN%
set zformat=zip

set extraoptions=-xr!Temp -xr!Junk

set zcmd="c:\program files\7-zip\7z" a -t%zformat% -r %extraoptions%
set fname=%thedir%_%mydate%_%mytime%.%zformat%

echo %zcmd% ..\%fname% .\
%zcmd% ..\%fname% .\


As an example if I put this zipcurdir.bat file in my Documents\Arduino\ folder and run it, I get the file in the parent directory: "Arduino_220506_0615.zip"

The only thing neat about this batch file is the autonaming of the created file based on the current directory and the fact that you never have to modify the batch file no matter where you put it.

77
Living Room / Re: Arduino anyone?
« on: May 04, 2022, 10:20 AM »
Video of my espresso scale in progress can be seen here at the 11:12 mark:
https://youtu.be/h-m7h_l1SJg?t=673

78
Yeah that would be very easy.. I'll add it.

79
Living Room / Re: Arduino anyone?
« on: April 29, 2022, 11:43 PM »
It's such a crazy feeling to be sitting tinkering with a $25 device on a little cutting board and realize you are playing with something that the equivalent of which 60 years ago probably would have cost half a million dollars and been the size of a hotel lobby, and taken a team of people a year to assemble and debug.

80
Living Room / Re: Arduino anyone?
« on: April 29, 2022, 11:33 PM »
I have to agree with you, the ease of just writing a little code and uploading it and communicating back and forth make it a really enjoyable platform; the ease of sending info back to display on the pc console window is another thing that makes it relatively painless to tinker with.

The highlight of my recent project has been getting a nice little options menu system working with a 20x4 lcd screen and a rotary knob, based on a library called LCDMenuLib2.

The ease of use of 3rd party libraries has also been a bright spot in working with the Arduino family.

So far I've only messed with the Arduino UNO and Mega.  The UNO seems quite limited in ram for program code and global variables, but nearly everything just compiles and works fine on the big brother Mega, so it's easy to upgrade when you need to.

Pages: prev1 ... 11 12 13 14 15 [16] 17 18 19 20 21 ... 7553next
Go to full version