├── Books └── HowToBeAProgrammer.pdf ├── Inkscape ├── README.md ├── pdf-from-svg.sh └── tex-from-svg.sh ├── PowerPoint ├── Joels-Powerpoint-Macros-2010-v1.2.pptm └── powerpoint2pdf.vb ├── README.md ├── Visio └── convert │ ├── convert-all.bat │ ├── convert-drag-n-drop.bat │ ├── convert-smart.bat │ ├── convert-smart.ps1 │ └── convert.vbs └── pdfcrop ├── README.md └── crop.sh /Books/HowToBeAProgrammer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftsrg/cheat-sheets/01e1bf7638bc8d2f4ec47c19982cf5daff95c039/Books/HowToBeAProgrammer.pdf -------------------------------------------------------------------------------- /Inkscape/README.md: -------------------------------------------------------------------------------- 1 | SVG to PDF/TeX conversion. 2 | 3 | Check the [How to include an SVG image in LaTeX](https://www.ctan.org/tex-archive/info/svg-inkscape) work for details. 4 | 5 | * `pdf-from-svg.sh` - convert SVG files to PDFs, to be included as images 6 | * `tex-from-svg.sh` - convert SVG files to TeX files, to be included as TeX code 7 | 8 | -------------------------------------------------------------------------------- /Inkscape/pdf-from-svg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for f in *.svg; do 4 | inkscape -D -z --file=$f --export-pdf "${f%.svg}.pdf" 5 | done 6 | -------------------------------------------------------------------------------- /Inkscape/tex-from-svg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for f in *.svg; do 4 | inkscape -D -z --file=$f --export-pdf "${f%.svg}.pdf" --export-latex 5 | done 6 | -------------------------------------------------------------------------------- /PowerPoint/Joels-Powerpoint-Macros-2010-v1.2.pptm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ftsrg/cheat-sheets/01e1bf7638bc8d2f4ec47c19982cf5daff95c039/PowerPoint/Joels-Powerpoint-Macros-2010-v1.2.pptm -------------------------------------------------------------------------------- /PowerPoint/powerpoint2pdf.vb: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | 3 | Sub AddElements() 4 | Dim shp As Shape 5 | 6 | Dim i As Integer, n As Integer 7 | n = ActivePresentation.Slides.Count 8 | For i = 1 To n 9 | Dim s As Slide 10 | Set s = ActivePresentation.Slides(i) 11 | s.SlideShowTransition.Hidden = msoTrue 12 | 13 | Dim max As Integer: max = AnimationElements(s) 14 | Dim k As Integer, s2 As Slide 15 | For k = 1 To max 16 | Set s2 = s.Duplicate(1) 17 | s2.Name = "AutoGenerated: " & s2.SlideID 18 | s2.SlideShowTransition.Hidden = msoFalse 19 | s2.MoveTo ActivePresentation.Slides.Count 20 | 21 | Dim i2 As Integer, h As Shape 22 | Dim Del As New Collection 23 | For i2 = s2.Shapes.Count To 1 Step -1 24 | Set h = s2.Shapes(i2) 25 | If Not IsVisible(s2, h, k) Then Del.Add h 26 | Next 27 | Dim j As Integer 28 | For j = s.TimeLine.MainSequence.Count To 1 Step -1 29 | s2.TimeLine.MainSequence.Item(1).Delete 30 | Next 31 | For j = Del.Count To 1 Step -1 32 | Del(j).Delete 33 | Del.Remove j 34 | Next 35 | Next 36 | Next 37 | End Sub 38 | 39 | 'is the shape on this slide visible at point this time step (1..n) 40 | Function IsVisible(s As Slide, h As Shape, i As Integer) As Boolean 41 | 42 | 'first search for a start state 43 | Dim e As Effect 44 | IsVisible = True 45 | For Each e In s.TimeLine.MainSequence 46 | If e.Shape Is h Then 47 | IsVisible = Not (e.Exit = msoFalse) 48 | Exit For 49 | End If 50 | Next 51 | 52 | 'now run forward animating it 53 | Dim n As Integer: n = 1 54 | For Each e In s.TimeLine.MainSequence 55 | If e.Timing.TriggerType = msoAnimTriggerOnPageClick Then n = n + 1 56 | If n > i Then Exit For 57 | If e.Shape Is h Then IsVisible = (e.Exit = msoFalse) 58 | Next 59 | End Function 60 | 61 | 'How many animation steps are there 62 | '1 for a slide with no additional elements 63 | Function AnimationElements(s As Slide) As Integer 64 | AnimationElements = 1 65 | Dim e As Effect 66 | For Each e In s.TimeLine.MainSequence 67 | If e.Timing.TriggerType = msoAnimTriggerOnPageClick Then 68 | AnimationElements = AnimationElements + 1 69 | End If 70 | Next 71 | End Function 72 | 73 | Sub RemElements() 74 | Dim i As Integer, n As Integer 75 | Dim s As Slide 76 | n = ActivePresentation.Slides.Count 77 | For i = n To 1 Step -1 78 | Set s = ActivePresentation.Slides(i) 79 | If s.SlideShowTransition.Hidden = msoTrue Then 80 | s.SlideShowTransition.Hidden = msoFalse 81 | ElseIf Left$(s.Name, 13) = "AutoGenerated" Then 82 | s.Delete 83 | End If 84 | Next 85 | End Sub -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cheat Sheets 2 | ============ 3 | 4 | * Getting started tutorials and cheat sheets for various technologies used in our projects. 5 | * A collection of recommended readings, research guides, fake research papers, web comics. 6 | 7 | ## [Cheat sheets wiki](https://github.com/FTSRG/cheat-sheets/wiki) 8 | -------------------------------------------------------------------------------- /Visio/convert/convert-all.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for %%i in (*.vsd*) do cscript convert.vbs "%~dp0%%i" 3 | move *.pdf ../src/figures/ 4 | -------------------------------------------------------------------------------- /Visio/convert/convert-drag-n-drop.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cscript convert.vbs %1 3 | move *.pdf ../src/figures/ 4 | -------------------------------------------------------------------------------- /Visio/convert/convert-smart.bat: -------------------------------------------------------------------------------- 1 | PowerShell.exe -ExecutionPolicy Bypass -File convert-smart.ps1 2 | -------------------------------------------------------------------------------- /Visio/convert/convert-smart.ps1: -------------------------------------------------------------------------------- 1 | Foreach ($visioFile in Get-ChildItem *.vsdx) { 2 | $figuresPath = Resolve-Path "..\" 3 | $pdfFilePath = "$figuresPath\$($visioFile.Name.TrimEnd('vsdx'))pdf" 4 | if ((-not (Test-Path $pdfFilePath)) -or ((Get-Item $pdfFilePath).LastWriteTime -lt ($visioFile.LastWriteTime))) { 5 | Write-Host "converting $($visioFile.Name)" 6 | cscript convert.vbs $visioFile.FullName 7 | } 8 | 9 | } 10 | mv *.pdf ../ -Force 11 | -------------------------------------------------------------------------------- /Visio/convert/convert.vbs: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | 3 | Main() 4 | 5 | Sub Main() 6 | If WScript.Arguments.Count > 0 Then 7 | Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") 8 | Dim i 9 | For i = 0 to wscript.arguments.count - 1 10 | Dim strFilePath : strFilePath = WScript.Arguments.Item(i) 11 | Dim dirPath : dirPath = objFSO.GetParentFolderName(strFilePath) 12 | Dim fileBaseName : fileBaseName = objFSO.GetBaseName(strFilePath) 13 | 'WScript.Echo strFilePath 14 | Dim strNewFileName : strNewFileName = dirPath & "\" & fileBaseName & ".pdf" 15 | 'WScript.Echo strNewFileName 16 | Dim strFileExt : strFileExt = UCase(objFSO.GetExtensionName(strFilePath)) 17 | Select Case strFileExt 18 | Case "VSD" 19 | VSD2PDF strFilePath, strNewFileName 20 | Case "VSDX" 21 | VSD2PDF strFilePath, strNewFileName 22 | Case Else 23 | WScript.Echo "Extension Type: " & strFileExt 24 | End Select 25 | Next 26 | Else 27 | msgbox("Choose a file to convert.") 28 | End If 29 | End Sub 30 | 31 | Sub VSD2PDF(strSourceFile, strDestFile) 32 | Const xlTypePDF = 1 33 | Const visOpenRO = 2 34 | Const visOpenMinimized = 16 35 | Const visOpenHidden = 64 36 | Const visOpenMacrosDisabled = 128 37 | Const visOpenNoWorkspace = 256 38 | 39 | Dim objVisio : Set objVisio = CreateObject("Visio.Application") 40 | Dim objeDoc : Set objeDoc = objVisio.Documents.OpenEx(strSourceFile, visOpenRO + visOpenMinimized + visOpenHidden + visOpenMacrosDisabled + visOpenNoWorkspace) 41 | objeDoc.ExportAsFixedFormat xlTypePDF, strDestFile, 1, 0 42 | objeDoc.Close 43 | objVisio.Quit 44 | End Sub 45 | -------------------------------------------------------------------------------- /pdfcrop/README.md: -------------------------------------------------------------------------------- 1 | Use [pdfcrop](http://pdfcrop.sourceforge.net/). 2 | 3 | On Ubuntu, simply install it with `sudo apt-get install pdfcrop`. 4 | -------------------------------------------------------------------------------- /pdfcrop/crop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for f in *.pdf; do 4 | g=${f%.*} 5 | pdfcrop $g.pdf && mv $g-crop.pdf $g.pdf 6 | done 7 | --------------------------------------------------------------------------------