jq is useful to slice, filter, map and transform structured json data.
brew install jq
| //> using scala 3.3 | |
| import scala.util.{Failure, NotGiven, Success, Try, boundary} | |
| import boundary.{Label, break} | |
| import scala.annotation.targetName | |
| /** | |
| * Proof of concept implementation of a syntax similar to Kotlin and | |
| * typescript. Within the context provided by [[getEither]], you can call | |
| * `?` on any optional/failable type (currently supports [[Option]], |
| /* | |
| Instagram API: send direct messages from a web browser | |
| Since April 2020, Instagram has a web version to send and read direct messages so my Instagram scripts are not longer needed and I would not recommend using them unless you really need it, to avoid being banned | |
| (never happened to me with Instagram but WhatsApp is owned by Facebook also and they did it to users registering from an unofficial app like yowsup: https://github.com/tgalal/yowsup/commit/88b8ad9581fa22dac330ee3a05fec4e485dfa634#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5) | |
| For browser setup, see script instagram-api_direct_messages_backup.js | |
| Instagram web version sessionid cookie does not allow sending messages so we need to log in manually | |
| Signature should match signed_body data (using HMAC-SHA256 with private key) but wrong signature or key may work also. |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright 2017 Google Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | |
| in compliance with the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software distributed under the License |
| /* Chrome eklentisi de şurada : https://github.com/riza/yemeksepeti-randomer */ | |
| var items = []; $('.ys-item').find('.head').find('.restaurantName').each(function(i,v) { items.push($(this).html()); });console.log(items[Math.floor(Math.random()*items.length)]); |
| import play.api.libs.ws.WS | |
| import play.api.mvc.MultipartFormData.FilePart | |
| import play.api.mvc.MultipartFormData | |
| import utilities.MultipartFormDataWriteable._ | |
| ... | |
| val url = "https://example.com" | |
| val dataParts = Map( |
| package utilities | |
| import java.io.{ByteArrayOutputStream, File} | |
| import com.ning.http.client.FluentCaseInsensitiveStringsMap | |
| import com.ning.http.multipart.{MultipartRequestEntity, FilePart, StringPart} | |
| import play.api.http.HeaderNames._ | |
| import play.api.http.{ContentTypeOf, Writeable} | |
| import play.api.mvc.{Codec, MultipartFormData} |
| package controllers | |
| import env.Env | |
| import play.api.libs.json.JsArray | |
| import play.api.mvc._ | |
| import play.api.libs.concurrent.Execution.Implicits._ | |
| // here's where the injection takes place | |
| class Application(env: Env) extends Controller { | |
| import env._ // to avoid writing something like env.WS.url() or env.configuration.get... |