Talk by Carin Meier @gigasquid
http://www.infoq.com/presentations/Why-is-a-Monad-Like-a-Writing-Desk
| @Grab(group='commons-net', module='commons-net', version='2.0') | |
| import org.apache.commons.net.ftp.FTPClient | |
| println("About to connect...."); | |
| new FTPClient().with { | |
| connect "some-server.some-domain.com" | |
| enterLocalPassiveMode() | |
| login "your-username", "your-password" | |
| changeWorkingDirectory "/var/appl/some/remote/dir/" | |
| def incomingFile = new File("some-file-to-retrieve.log") |
http://www.infoq.com/presentations/Why-is-a-Monad-Like-a-Writing-Desk
| // Boring | |
| if (isThisAwesome) { | |
| alert('yes'); // it's not | |
| } | |
| // Awesome | |
| isThisAwesome && alert('yes'); | |
| // Also cool for guarding your code | |
| var aCoolFunction = undefined; |
| crypto = require('crypto'); | |
| #Quick MD5 of text | |
| text = "MD5 this text!" | |
| md5hash1 = crypto.createHash('md5').update(text).digest("hex") | |
| #MD5 of text with updates | |
| m = crypto.createHash('md5') | |
| m.update("MD5 ") | |
| m.update("this ") |
| apply plugin:'groovy' | |
| project.javafxHome = System.env['JAVAFX_HOME'] | |
| repositories { mavenCentral() } | |
| dependencies { | |
| groovy 'org.codehaus.groovy:groovy-all:1.8.6' | |
| compile 'org.codehaus.groovyfx:groovyfx:0.3.1' | |
| compile files("${javafxHome}/rt/lib/jfxrt.jar") |
| ; Stupid simple autoit script for cleaning up "orphaned" notepad instances | |
| ; I end up with dozens of notepad instances after a day of coding and it's a pain to close all these manually | |
| ; as I do want to keep some of them. | |
| ; Public Domain | |
| ; Philip Bjorge | |
| ; June 2, 2012 | |
| Local $windows=WinList() | |
| For $i = 1 To $windows[0][0] | |
| If StringInStr($windows[$i][0], "Notepad", 0) Then |
| ; sleep statements are added only to illustrate the focus on buttons | |
| ;read arguments | |
| Local $pathToSave=$CmdLine[1] | |
| ; get the handle of main window | |
| Local $windHandle=WinGetHandle("[Class:IEFrame]", "") | |
| Local $winTitle = "[HANDLE:" & $windHandle & "]"; | |
| ;get coordinates of default HWND | |
| Local $ctlText=ControlGetPos ($winTitle, "", "[Class:DirectUIHWND;INSTANCE:1]") |
| #include <GUIConstantsEx.au3> | |
| #include <WindowsConstants.au3> | |
| #include <ButtonConstants.au3> | |
| #include <StaticConstants.au3> | |
| #include <GDIPlus.au3> | |
| #include <File.au3> | |
| #include <Array.au3> | |
| ; Creating GUI and controls GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] ) | |
| $hGui = GUICreate("Resize JPEG", 320, 130, @DesktopWidth / 2 - 192, _ | |
| @DesktopHeight / 2 - 235, -1, $WS_EX_ACCEPTFILES) |
| ; =================================================================== | |
| ; HTTP UDF's | |
| ; v0.5 | |
| ; | |
| ; By: Greg "Overload" Laabs | |
| ; Last Updated: 07-22-06 | |
| ; Tested with AutoIt Version 3.1.1.131 | |
| ; Extra requirements: Nothing! | |
| ; | |
| ; A set of functions that allow you to download webpages and submit |