This file contains hidden or 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
$ python3 --version | |
Python 3.4.5 | |
$ python3 -m venv myenv | |
$ cd myenv | |
$ bin/pip install requests | |
Collecting requests | |
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl | |
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests) | |
Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl | |
Collecting idna<2.9,>=2.5 (from requests) |
This file contains hidden or 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 -eu | |
shopt -s failglob | |
force= | |
while getopts "f" flag | |
do | |
case $flag in | |
f) force=y ;; | |
esac | |
done |
This file contains hidden or 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
class constant_tzinfo(datetime.tzinfo): | |
def __init__(self, offset_mins): self.offset_mins = offset_mins | |
def utcoffset(self, dt): return datetime.timedelta(minutes=self.offset_mins) | |
def dst(self, dt): return None | |
def tzname(self, dt): return '%+03d:%02d' % (int(self.offset_mins / 60.0), abs(self.offset_mins) % 60) |
This file contains hidden or 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
[liveuser@localhost-live ~]$ sudo fsck /dev/sda1 | |
We trust you have received the usual lecture from the local System | |
Administrator. It usually boils down to these three things: | |
#1) Respect the privacy of others. | |
#2) Think before you type. | |
#3) With great power comes great responsibility. | |
fsck from util-linux 2.35.1 |
This file contains hidden or 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 org.junit.jupiter.api.Test; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.Set; |
This file contains hidden or 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
#! /usr/bin/env python3 | |
import html.parser | |
import contextlib | |
import re | |
import csv | |
text_pattern = re.compile(r'([A-Z ()&!0-9]+) \(([^)]+)\) (.*)') | |
meta_pattern = re.compile(r'Dir: ([^,]+),? ([A-Za-z ]+), ([^0-9]+), ([0-9]+) ?mins?.?') |
This file contains hidden or 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 javax.imageio.ImageIO; | |
import java.awt.image.BufferedImage; | |
import java.awt.image.WritableRaster; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Objects; |
This file contains hidden or 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 jakarta.json.JsonObject; | |
import jakarta.json.spi.JsonProvider; | |
import jakarta.json.stream.JsonParser; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class ParseTest { |
This file contains hidden or 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
class Foo { | |
public static <T> Function<T, Stream<T>> foo(Predicate<T> predicate) { | |
return new Function<>() { | |
private T previous; | |
@Override | |
public Stream<T> apply(T current) { | |
if (predicate.test(current)) { | |
if (previous != null) { | |
T previous = this.previous; |
This file contains hidden or 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
public class Class1 { | |
public static <Type1, Type2 extends Collection<Type1>> Type2 method(Supplier<Type2> parameter1, Collection<Type1> parameter2, Collection<Type1> parameter3) { | |
Type2 variable = Stream.concat(parameter2.stream() | |
.filter(Predicate.not(parameter3::contains)), | |
parameter3.stream() | |
.filter(Predicate.not(parameter2::contains))) | |
.collect(Collectors.toCollection(parameter1)); | |
return variable; | |
} |