Sunday, December 16, 2018

Stephen Jungels is Cool, But..

Why not tell people what to do when you don't have lynx on your Cygwin?

https://github.com/transcode-open/apt-cyg#quick-start

Ans :

$ wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg

$ install apt-cyg /bin

An NEdit Shortcut for Inserting the Date


Below ======= is old pre GPT stuff 😊chatGPT is the best tool for second-guessing yourself 😊

So, just use (works for bash and the csh variants)

date | awk '{print $2, $3, $6}'

==========================

You need to execute a unix command (depending of course on the format you want. This applies to 12/16/18 style date ) like

$ date +%m/%d/%y

das große problem : NEdit interprets the "%" :(

So you have to tell it to send unix something that date can then use. That is, the 

"%m/%d/%y" needs to magically appear before the date command is executed.

Enter command substitution and the answer :

$ date +`perl -e 'print "\045m/\045d/\045y";'`

You see how it arbeitet? First, the perl command is executed and the result is placed in the date command. The perl command uses octal codes to put the % in the print statement - so NEdit is clueless. 

So, what do YOU do? Do ALT-x, and enter this, and see that it works. Then, go into record macro mode and record this, and then do the Preferences > Default Settings > Customize Menus .. thing :)

Enjoy!

Now, what if you want something like "Dec 16 2018" :

date "+%b %d %Y"

Phew - how little I know :) If you use backticks for command substitution, this new one will give you grief. Turns out, the professional way to do command substitution is $( )

So, start with (in NEdit ALT-x execute command dialog ) :

date "+$(perl -e 'print "\045b \045d \045Y";')"

And all is well :) Thanks to the maestros :)

Friday, December 14, 2018

Killer Excel Macro : A Button to Toggle Hide/Unhide of Rows

  • Start with a file that's already named .xlsm . Save time later :)
  • Know which rows? Say 10 to 12 (inclusive)
  • Right click on the name of the Sheet on the bottom of the Excel window and choose "View Code"
  • Now, paste :
Sub sbHidingUnHideRows()
    If Rows("10").EntireRow.Hidden Then
    'To unHide Rows 10 to 12
        Rows("10:12").EntireRow.Hidden = False
    Else
    'To Hide Rows 10 to 12
        Rows("10:12").EntireRow.Hidden = True
    End If
End Sub

  • And tweak it to be what you want. Then, do ALT-Q. If you go into Macros, you'll see this one..
  • Then, to create the button, go to Insert (File, Home, Insert, Draw, on the top of the Excel window)
  • Here, choose Shapes and put down something nice. Remember da Vinci : Simplicity is the ultimate sophistication.
  • Edit the Text associated with this shape.
  • Then, right-click on the shape and choose Assign Macro, pick the one you just created. And..
  • You're in business.. 

Autodesk's Beginners PCB Design Tips

(Right click and choose Open in New Tab, and, there, your mouse pointer turns into a magnifying glass)

https://www.autodesk.com/products/eagle/blog/top-10-pcb-component-placement-tips-pcb-beginner/

Sunday, December 02, 2018

Using a File on Your PC as the Background Image in CSS

This one's hard to find online for some reason

body {
         background-image : url("C:\path\to\file");
}

Seems right intuitively, except, it doesn't work. What does work? "file:///C:/path/to/image"

How should you know? Open the file in your browser first - and pay attention :)

Thursday, November 22, 2018

Another Key to Jewish Success

 From the bio of the father of fractals :

During his first two school years, he was tutored privately by an uncle who despised rote learning: "Most of my time was spent playing chess, reading maps and learning how to open my eyes to everything around me."