This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAQ | |
Why open a new window for the authorization? | |
Because if you load the contents of the auth page directly IN a sidebar (or script) using HtmlService, its buttons won't work because they've been cajoled. | |
Why not just the the access token provided by GAS Libraries? | |
Because lord only knows what that thing is scoped for. | |
How do I clear my token? | |
Pass ?reset parameter to the url, or call clearMyAuthToken() directly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovyx.gpars.actor.* | |
import org.codehaus.groovy.runtime.NullObject | |
import groovy.time.TimeCategory | |
DynamicDispatchActor actor = Actors.messageHandler { | |
when { String name -> | |
println "Nice to meet you $name" | |
} | |
when { Integer age -> | |
println "You look younger than $age" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovyx.gpars.actor.DynamicDispatchActor | |
import org.codehaus.groovy.runtime.NullObject | |
import groovy.time.TimeCategory | |
def actor = new DynamicDispatchActor(){ | |
private int counter = 0 | |
void onMessage(String message) { | |
counter += message.size() | |
println "Actor received string $message" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovyx.gpars.actor.* | |
import org.codehaus.groovy.runtime.NullObject | |
import groovy.time.TimeCategory | |
// use the DSL to create our actor instead of | |
def actor = Actors.actor { | |
loop { | |
// NOTE the actor's message handler can only take 0 or 1 args | |
react { String word -> | |
println "Actor received $word" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static groovyx.gpars.dataflow.Dataflow.* | |
import groovyx.gpars.dataflow.* | |
// The Dataflow Variables have a pretty straightforward semantics. | |
// When a task needs to read a value from DataflowVariable | |
// (through the val property), it will block until the value has been | |
// set by another task or thread (using the '<<' operator). | |
// Each DataflowVariable can be set only once in its lifetime. | |
// Notice that you don't have to bother with ordering and synchronizing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static groovyx.gpars.dataflow.Dataflow.task | |
import groovyx.gpars.dataflow.DataflowQueue | |
import java.util.concurrent.atomic.AtomicBoolean | |
final def buffer = new DataflowQueue() | |
final done = new AtomicBoolean() | |
def t = task { | |
while(!done.get()) { | |
def word = System.console().readLine 'Enter some text (or "stop" to stop): ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM USE THIS FILE IF YOU HAVE GRAILS CONFIGURED | |
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^ | |
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^ | |
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)"" | |
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p | |
grails add-proxy myproxy "--host=proxy_server" "--port=8020" "--username=%USERNAME%" "--password=%password%" | |
grails use-proxy myproxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.shouldyou; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.text.DecimalFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.ArrayList; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package be.shouldyou; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gov.ne.revenue.mef.enhancement; | |
import java.lang.instrument.ClassFileTransformer; | |
import java.lang.instrument.IllegalClassFormatException; | |
import java.security.ProtectionDomain; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.instrument.classloading.LoadTimeWeaver; | |
import org.springframework.util.Assert; |
OlderNewer