Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// FocusMeditationAnimation
//
// Created by Amos Gyamfi on 8.2.2021.
//
import SwiftUI
struct ContentView: View {
@otamajakusi
otamajakusi / Dockerfile
Last active May 29, 2021 03:04
Dockerfile for YOLOv5 on Jetson Nano
FROM nvcr.io/nvidia/l4t-pytorch:r32.4.4-pth1.6-py3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y cmake libgtk2.0-dev wget
RUN wget https://nvidia.box.com/shared/static/9eptse6jyly1ggt9axbja2yrmj6pbarc.whl -O torch-1.6.0-cp36-cp36m-linux_aarch64.whl
RUN python3 -m pip install torch-1.6.0-cp36-cp36m-linux_aarch64.whl
RUN python3 -m pip install scikit-build
@redjoker011
redjoker011 / bitbucket-pipelines.yml
Last active April 27, 2024 17:34
Bitbucket CI/CD Pipeline Config for Vuejs App
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# Note variables start with `$` are repository variables added to bitbucket repo.
image: node:12.18.2
pipelines:
branches:
@jiz4oh
jiz4oh / default.custom.yaml
Last active November 9, 2024 14:14
Rime-配置
# 基础引擎框架配置,patch 会更新 default.yaml 文件
patch:
schema_list:
- schema: double_pinyin_flypy
- schema: luna_pinyin_simp
switcher/hotkeys:
# 切换选项菜单的快捷键
- "Alt+Shift+grave"
- "Control+grave"
@manju4ever
manju4ever / read_csv.go
Last active October 26, 2021 12:37
Read CSV From Go
package main
import (
"fmt"
"os"
"github.com/gocarina/gocsv"
)
/* users.csv
//...
Map<dynamic, dynamic> deviceInfo = {};
if (defaultTargetPlatform == TargetPlatform.android) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getAndroidDeviceInfo');
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
deviceInfo = await DeviceInfoPlugin.channel.invokeMethod('getIosDeviceInfo');
}
extra['device_info'] = deviceInfo.map((key, value) => MapEntry(key.toString(), value.toString()));
//...
@draveness
draveness / benchmark_foreign_key.go
Last active October 14, 2020 07:42
Benchmark Foreign Key
package main
import (
"testing"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
type Post struct {
@varunon9
varunon9 / AlwaysRunningAndroidService.md
Last active July 17, 2025 00:10
How to create an always running service in Android

Full Source Code: https://github.com/varunon9/DynamicWallpaper/tree/always_running_service

Steps-

  1. Create a Foreground Service (MyService.java)
  2. Create a Manifest registered Broadcast Receiver (MyReceiver.java) which will start your Foreground Service
  3. In onDestroy lifecycle of MyService, send a broadcast intent to MyReceiver
  4. Launch the MyService on app start from MainActivity (see step 8)
  5. With above 4 steps, MyService will always get re-started when killed as long as onDestroy of Service gets called
  6. onDestroy method of Service is not always guaranteed to be called and hence it might not get started again
<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="StravaGPX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
<metadata>
<time>2020-04-09T16:16:26Z</time>
</metadata>
<trk>
<name>Evening Run</name>
<type>9</type>
<trkseg>
<trkpt lat="47.0481700" lon="9.4382750">
@marcusvolz
marcusvolz / wildflowers.R
Created April 5, 2020 10:28
Wildflowers
# Load packages
library(generative) # devtools::install_github("marcusvolz/generative")
library(ggplot2)
for (i in c(3, 86, 111)) {
# Set parameters
seed <- i
set.seed(seed)
n <- 400
n_circles <- 4 # 4