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
function task1() { | |
return new Promise((resolve) =>{ | |
setTimeout(() => { | |
console.log('doing some work on state 1') | |
resolve({completed: true, value: 1}) | |
}, 50) | |
}) |
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
#include <chrono> | |
#include <iostream> | |
#include <queue> | |
#include <thread> | |
/* | |
* This program demonstrate that using one thread to write and another to read is ok to get ordered values from a queue. | |
* | |
* One thread generate a ordered sequence of number, another consumes print the sequence |
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
/* | |
* | |
* Testing bi-directional relationship in Realm. | |
* | |
*/ | |
let Realm = require('realm') | |
const PersonSchema = { | |
name: '_Person', |
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 win32com.client | |
import sched, time | |
import json | |
import requests | |
import sys | |
host = "https://notify-uat.e4ff.pro-eu-west-1.openshiftapps.com/notify" | |
REDIRECT_TO = 'your-email@server.com' | |
def look(obj): |
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
def puzzleSolutionPartOne(puzzle): | |
lhs = "" | |
units = [] | |
react = lambda a,b: a.lower() == b.lower() and a != b | |
for candidate in puzzle: | |
if lhs == "": | |
lhs = candidate | |
continue |
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
def getRunningPod(label) { | |
def runningPod = sh ( | |
script: "oc get pod --selector=application=${label} -o=jsonpath={.items[0].metadata.name}", | |
returnStdout: true ).trim() | |
return runningPod | |
} | |
def getRoute(label) { | |
def route = sh ( | |
script: " oc get route --selector=application=${label} -o jsonpath={.spec.host}", |
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
const { spawn } = require('child_process'); | |
function pull(action) { | |
const git = spawn('git', ['pull']) | |
git.stdout.on('data', function(data) { | |
let msg = data.toString() | |
console.log('[git pull]: ', msg) | |
if(!msg.includes('Already up to date.')){ |
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
#!/bin/bash | |
oc create dc $1 --image=$(oc get is $1 -o=jsonpath='{.status.dockerImageRepository}'):prod || true && | |
oc expose dc $1 --port=8080 -l app=$1 || true && | |
oc expose svc $1 -l app=$1 || true && | |
oc label dc $1 app=$1 production=true --overwrite=true || true | |
oc label svc $1 app=$1 production=true --overwrite=true || true | |
oc label route $1 app=$1 production=true --overwrite=true || true | |
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
const reaction = (a,b) => a.toLowerCase() === b.toLowerCase() && a !== b | |
const solvingPuzzleOne = (puzzle_input) =>{ | |
let lhs = '' | |
let tested = [] | |
let size = puzzle_input.length | |
for(let i=0; i<size; i++){ | |
let candidate = puzzle_input[i] | |
if(lhs === ''){ | |
lhs = candidate |
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
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>1.8</maven.compiler.source> | |
<maven.compiler.target>1.8</maven.compiler.target> | |
<lombok.version>1.16.18</lombok.version> | |
<jboss-logging.version>3.3.1.Final</jboss-logging.version> | |
</properties> |
NewerOlder