Skip to content

Instantly share code, notes, and snippets.

View InsulaVentus's full-sized avatar
🦆

Øyvind Strømmen InsulaVentus

🦆
View GitHub Profile
import argparse
import base64
import json
import requests
from datetime import datetime
from lxml import html
class ConfluenceBuildVersions(object):
"""

Run web-platform tests

$ ./mach wpt testing/web-platform/tests/webdriver/tests/cookies --webdriver-arg=-vv

Run .js tests

$ ./mach test testing/marionette/test_cookie.js

Listen on port 4242 locally:

$ nc -vvl -s localhost -p 4242
listening on [127.0.0.1] 4242 ...

Establish connection and send some text:

$ echo "foo" | nc localhost 4242
import java.util.Stack;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Scratch {
public static void main(String[] args) {
System.out.println(reformat("01:20")); //1t 20m
System.out.println(reformat("01:00")); //1t
System.out.println(reformat("00:23")); //23m
import escape from "escape-html";
export const escapeExpression = (strings: TemplateStringsArray, ...unsafeExpressions: string[]) => {
const escaped: string[] = [];
let unsafeExpressionIndex = 0;
let templateStringIndex = 0;
for (let i = 0; i < strings.length + unsafeExpressions.length; i++) {
package no.statnett.ois;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
public class WikipediaArticle {
Write-Output "Waiting for docker daemon (com.docker.proxy) to start"
Do
{
$docker = Get-Process "com.docker.proxy" -ErrorAction SilentlyContinue
Write-Output "Waiting..."
Start-Sleep 3
} While (!$docker)
Write-Output "Docker has started"
@InsulaVentus
InsulaVentus / ScratchyMcScratch.java
Last active November 8, 2018 12:05
A functional alternative to an if-else block, using Optional.
package main;
import java.util.Optional;
import static java.lang.String.format;
public class ScratchyMcScratch {
public static void main(String[] args) {
final ScratchyMcScratch mcScratch = new ScratchyMcScratch();

Ref: https://docs.docker.com/network

Features

  • Automatic DNS resolution between containers
  • Containers in same user defined bridge network automatically exposes all ports to each other
  • Containers can be attached and detached from user-defined networks on the fly. As apposed to default bridge networks where you need to stop the container and recreate it with different options
@InsulaVentus
InsulaVentus / Useful-git-commands.md
Last active January 24, 2019 08:28
Miscellaneous git commands with descriptions

Reset commited changes to one or more files. (HEAD~1) refers to the commit prior to HEAD

git checkout HEAD~1 -- file1/to/restore file2/to/restore

Pull a branch without checking it out

git fetch origin name_of_branch:name_of_branch