Skip to content

Instantly share code, notes, and snippets.

@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")
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
@crazy4groovy
crazy4groovy / md5.coffee
Last active February 8, 2017 15:00 — forked from amscotti/md5.coffee
MD5 examples
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 ")
@crazy4groovy
crazy4groovy / build.gradle
Last active December 23, 2015 13:29 — forked from deanriverson/build.gradle
Gradle build file for GroovyFX.
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")
; Original script: http://www.autoitscript.com/forum/topic/100125-disable-close-button/#entry716490
; USer32.dll functions: http://msdn.microsoft.com/en-us/library/ms647985(v=vs.85).aspx
; "The first script ( remove the button ) work fine on XP, the second ( the disable script ) disable only the close button, i have tested both version, the dll and the GuiMenu"
; See http://www.autoitscript.com/forum/topic/147424-disable-or-remove-close-minimize-maximize-buttons-on-any-window-in-runtime/#entry1045390
; ---------------------------------------
#include <GuiMenu.au3>
Run("Notepad")
WinWait("Untitled - Notepad")
; 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)
@crazy4groovy
crazy4groovy / HTTP.au3
Created September 5, 2013 18:35 — forked from umarquez/HTTP.au3
; ===================================================================
; 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