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 TestContext extends MockContext { | |
@Override public MockResources getResources() { | |
return new TestResources(); | |
} | |
} | |
class TestResources extends MockResources { | |
@Override public String getString(int id) { | |
return "foo is a bar"; | |
} |
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
from collections import namedtuple | |
from hashlib import sha256 | |
from typing import List, Optional | |
def makehash(data: str) -> str: | |
return sha256(data.encode()).hexdigest() | |
Block = namedtuple("Block", ["data", "hash", "prevhash"]) |
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 | |
# | |
# Find the IP address of a client by MAC on the same network. Sudo privilege and nmap required. | |
# | |
# usage: ./findbymac.sh <MAC_ADDRESS> | |
# | |
# The first argument to the script is the MAC address or part of the MAC address. | |
# | |
# example: sudo ./findbymac.sh "aa:b8" | |
# |
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
from . import logging | |
from .logging import log | |
def main(args): | |
# set up logging from the arguments | |
logging.init(args) | |
log.info("hello world!") | |
if __name__ == "__main__": |
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 kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.Runnable | |
import kotlin.coroutines.CoroutineContext | |
/** | |
* @author Károly Kiripolszky <[email protected]> | |
*/ | |
class TestCoroutineDispatcher : CoroutineDispatcher() { | |
override fun dispatch(context: CoroutineContext, block: Runnable) { | |
block.run() |
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 androidx.lifecycle.Lifecycle.State | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.LifecycleRegistry | |
/** | |
* @author Károly Kiripolszky <[email protected]> | |
*/ | |
class TestLifecycleOwner(state: State = State.STARTED) : LifecycleOwner { | |
private val lifecycle = LifecycleRegistry(this) |
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
long rand(int min, int max) { | |
long result; | |
for (int i = 0; i < analogRead(A0); i++) | |
{ | |
randomSeed(analogRead(A0)); | |
result = random(min, max); | |
} | |
return result; | |
} |
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
M104 S0; Set Hot-end to 0C (off) | |
M140 S0; Set bed to 0C (off) | |
G91; Relative positioning | |
G0 Z50; Move +50 units on Z | |
G1 Y180 F9000; Feed the bed forward making removal easy | |
M84; Disable motors | |
M106 S0; Disable fan |
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
# generated by PrusaSlicer 2.3.0+linux-x64 on 2021-01-29 at 06:27:08 UTC | |
avoid_crossing_perimeters = 1 | |
avoid_crossing_perimeters_max_detour = 0 | |
bottom_fill_pattern = monotonic | |
bottom_solid_layers = 5 | |
bottom_solid_min_thickness = 0.5 | |
bridge_acceleration = 1000 | |
bridge_angle = 0 | |
bridge_flow_ratio = 1 | |
bridge_speed = 35 |
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
# generated by PrusaSlicer 2.3.0+linux-x64 on 2021-01-29 at 10:18:59 UTC | |
bed_temperature = 50 | |
bridge_fan_speed = 100 | |
compatible_printers = | |
compatible_printers_condition = nozzle_diameter[0]>0.35 and printer_model!="MK2SMM" and printer_model!="MINI" and num_extruders==1 && ! (printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK3.*/ and single_extruder_multi_material) | |
compatible_prints = | |
compatible_prints_condition = | |
cooling = 1 | |
disable_fan_first_layers = 5 | |
end_filament_gcode = "; Filament-specific end gcode" |