- Allow
colima start
to run without password:
cat <<-EOF | sudo tee /private/etc/sudoers.d/colima
%admin ALL=NOPASSWD: /bin/rm -rf /var/run/docker.sock
%admin ALL=NOPASSWD: /bin/ln -s $HOME/.colima/docker.sock /var/run/docker.sock
EOF
.factory('someService', ['$http', function ($http) { | |
return { | |
async: function () { | |
return $http.get('someUrl').then(function (response) { | |
return response.data; | |
}); | |
} | |
}; | |
}]).controller('someController', ['$scope', 'someService', function ($scope, someService) { | |
someService.async().then(function (d) { |
import UIKit | |
// Enum copied into playground directly from DJI third party SDK | |
public enum DJICameraExposureMode : UInt { | |
case Program | |
case Shutter | |
case Aperture | |
case Manual | |
case Unknown |
--- | |
version: '3' | |
services: | |
zookeeper: | |
image: zookeeper | |
ports: | |
- 2181:2181 | |
kafka: | |
image: confluentinc/cp-kafka | |
ports: |
#!/bin/zsh | |
# Assumes you start with three directories of images in png format with the same name - 1x, 2x and 3x | |
# Call with four params | |
# zip_directories_to_xcassets.zsh name_of_asset_file directory_of_1x_pngs directory_of_2x_pngs directory_of_3x_pngs | |
ASSETS_DIR=$1.xcassets | |
D1=$2 | |
D2=$3 | |
D3=$4 |
/** | |
* Could't get adafruit's image reader working on Teensy 4.1 - doesn't seem to be compatible with | |
* Teensy's version of the SD card library | |
* | |
* But - the TFT object has this method: | |
* | |
* void Adafruit_GFX::drawRGBBitmap( | |
* int16_t x, | |
* int16_t y, | |
* uint16_t * bitmap, |
public class Convert { | |
public static void main(String[] args) { | |
String pngFile = args[0]; | |
String datFile = args[1]; | |
try { | |
BufferedImage image = ImageIO.read(new File(pngFile)); | |
try ( | |
LittleEndianDataOutputStream outputStream = new LittleEndianDataOutputStream(new FileOutputStream(datFile)) |
@RestController | |
class Controller(val service: SomeService) { | |
@GetMapping("/something") | |
fun all() = service.all() | |
@PostMapping("/something") | |
suspend fun save(@RequestBody something: CreateDTO) = service.create(something) | |
@PutMapping("/something/{id}") | |
suspend fun update(@PathVariable id: Long, @RequestBody updates: UpdateDTO) = service.update(id, updates) |
<html> | |
<head> | |
<link | |
rel="stylesheet" | |
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" | |
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" | |
crossorigin="anonymous" | |
/> | |
<script | |
src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" |