Skip to content

Instantly share code, notes, and snippets.

View gist:de4fe5d252183d3c02080ba9ace99bc5
# .kube contents
▶ ls -al /Users/mmoci/.kube/
total 32
drwxr-xr-x 12 mmoci 1668562246 384 Dec 11 10:01 .
drwxr-xr-x+ 148 mmoci 1668562246 4736 Mar 25 17:09 ..
-rw-r--r--@ 1 mmoci 1668562246 6148 Jan 28 2019 .DS_Store
drwxr-xr-x 3 mmoci 1668562246 96 Mar 20 2017 cache
-rw------- 1 mmoci 1668562246 5862 Dec 11 10:01 config
drwxr-xr-x 3 mmoci 1668562246 96 Nov 26 2018 some-directory
View gist:bbc8f5c92b08e335d1be459d4cee11da
▶ ls -al /Users/mmoci/.kube/
total 32
drwxr-xr-x 12 mmoci 1668562246 384 Dec 11 10:01 .
drwxr-xr-x+ 148 mmoci 1668562246 4736 Mar 25 17:09 ..
-rw-r--r--@ 1 mmoci 1668562246 6148 Jan 28 2019 .DS_Store
drwxr-xr-x 3 mmoci 1668562246 96 Mar 20 2017 cache
-rw------- 1 mmoci 1668562246 5862 Dec 11 10:01 config
drwxr-xr-x 3 mmoci 1668562246 96 Nov 26 2018 a-directory
~
View init.el
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@mox601
mox601 / ReaderTest.java
Created Dec 27, 2017
Test with functional java's Reader to demonstrate Dependency Injection
View ReaderTest.java
package fm.mox.spikes.functionaljava;
import fj.F;
import fj.data.Reader;
import lombok.Value;
import lombok.experimental.Tolerate;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.math.BigInteger;
View ThrottlingTest.java
@Test
public void throttlingRxJava() throws Exception {
Observable<Long> everySecond = Observable.fromIterable(Arrays.asList(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L))
.map(aLong -> {
try {
Thread.sleep(1_000L);
} catch (InterruptedException e) {
//
}
View b.java
public class ATest {
@Test
public void test() {
JSONObject root = new JSONObject("{}");
List<TestC> list = new ArrayList<>();
TestC testC = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
TestC testC1 = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
View a.java
@Test
public void test() {
JSONObject root = new JSONObject("{}");
List<TestC> list = new ArrayList<>();
TestC testC = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
TestC testC1 = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
root.put("1", testC);
View abc.java
private static List<ServerAddress> parseServerAddresses(final String serverAddressesString) {
final String[] serversSplitOnComma = serverAddressesString.split(",");
final List<ServerAddress> serverAddresses = new ArrayList<>(3);
for (final String serverAndPort : serversSplitOnComma) {
final String[] splitOnColon = serverAndPort.split(":");
View a.json
{
"message": "ok",
"msgCode": 0,
"challengerSquad": {
"formation": "F_3_4_3",
"gk": {
"id": "p55083",
"position": "G",
"name": "Marco",
"lastName": "Sportiello",
View request.md
  • Header Authorization Token di autorizzazione Alfanumerico 100

Il token passato nell’header deve esser stato ottenuto attraverso un’autenticazione con credenziali applicative (application key)

  • FormParam token Token di cui va verificata l’autenticità Alfanumerico 100