Skip to content

Instantly share code, notes, and snippets.

View omerucel's full-sized avatar
🎯
Focusing

Ömer ÜCEL omerucel

🎯
Focusing
View GitHub Profile
@lukicdarkoo
lukicdarkoo / labelme2yolo.py
Created August 15, 2020 20:18
LabelMe to YOLO
"""
Converts LabelMe annotations to annotations compatible with YOLO.
The script does the following:
- cleans (!) the output directory and prepare it for training,
- splits the dataset on validation and training,
- converts all LabelMe annoations (*.json) to YOLO annoations (*.txt) and
- creates YOLO metadata (`.data`, `.names`, `train.txt` and `valid.txt`)
"""
import os
@HashNuke
HashNuke / SwiftUI-SplitView-MacOS.swift
Last active January 5, 2024 18:53
Using a NSSplitViewController with SwiftUI on mac to render SwiftUI views as split panes. Drop this code into a playground to try it out. SORRY MAC-OS ONLY. DOES NOT WORK ON IOS
import AppKit
import SwiftUI
// Delete this line if not using a playground
import PlaygroundSupport
struct ContentView: View {
var body: some View {
// if spacing is not set to zero, there will be a gap after the first row
@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 16, 2024 10:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@0xced
0xced / netcore single exe.md
Last active November 16, 2022 15:14
Building a .NET Core single exe for Linux on macOS or Windows

Building a .NET Core single exe for Linux on macOS or Windows

Run the .NET Core SDK docker image and share your working directory containing your .csproj file at /home in the container.

On Linux/macOS:

docker run --interactive --tty --rm --volume "$(pwd):/home" mcr.microsoft.com/dotnet/core/sdk:2.2 /bin/bash

On Windows:

@simplytunde
simplytunde / terraform_dynamodb.tf
Created February 6, 2018 08:54
Terraform DynamoDB Autoscaling
provider "aws" {
region = "us-west-1"
}
resource "aws_dynamodb_table" "test-database" {
name = "tenants"
read_capacity = 20
write_capacity = 20
hash_key = "roomNumber"
range_key = "name"
-- Description:
-- ------------
--
-- This is an example schema for storing collectd metrics in a TimescaleDB
-- dabase (see https://www.timescale.com/). It is based on the PostgreSQL
-- schema contributed by Sebastian Harl.
--
-- Prerequisities:
-- ---------------
--
@orenitamar
orenitamar / Dockerfile
Last active March 22, 2024 05:13
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@jlambe
jlambe / gist:a868d9b63d70902a12254ce47069d0e6
Created May 13, 2016 06:57
Twig - POEdit configuration
Create a Poedit project for your theme if you haven't already, and make sure to add __ on the Sources keywords tab and other gettext functions declared in WordPress: _e, ...
Go to Edit->Preferences.
On the Parsers tab, add a new parser with these settings:
Language: Twig
List of extensions: *.twig
Parser command: xgettext --language=Python --add-comments=TRANSLATORS --force-po -o %o %C %K %F
An item in keyword list: -k%k
An item in input files list: %f
Source code charset: --from-code=%c
Save and Update!
@Haosvit
Haosvit / AssetDatabaseOpenHelper.java
Last active June 17, 2016 05:22 — forked from wontondon/AssetDatabaseOpenHelper.java
Copy sqlite database from assets dir - Android
package com.javatarts.basketballgm.data;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
@armadsen
armadsen / openssl-build.sh
Last active April 17, 2022 22:14 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78