Skip to content

Instantly share code, notes, and snippets.

View widarlein's full-sized avatar
💃

Alexander Widar widarlein

💃
  • Gothenburg, Sweden
View GitHub Profile
@widarlein
widarlein / DirtSimpleInMemoryCookieJar.groovy
Created January 15, 2018 13:21
Extremely simple, non-expiring, in memory cookie jar for OkHTTP3 in groovy for quick and dirty scripts
import okhttp3.*
import java.util.*
class DirtSimpleInMemoryCookieJar implements CookieJar {
def store = [:]
List<Cookie> loadForRequest(HttpUrl url) {
def cookies = store[url.host()]
if (!cookies) return []
@widarlein
widarlein / sendSms.groovy
Created January 10, 2018 15:28
Pushbullet API Send SMS in groovy
@Grab("com.squareup.okhttp3:okhttp:3.9.0")
import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.Response
import groovy.json.JsonOutput
String PUSHBULLET_ACCESS_TOKEN = "ACCESSTOKEN"

Keybase proof

I hereby claim:

  • I am widarlein on github.
  • I am widar (https://keybase.io/widar) on keybase.
  • I have a public key whose fingerprint is 502A D3E3 D9B6 8252 7276 34B0 6C66 1050 530E D907

To claim this, I am signing this object: