Skip to content

Instantly share code, notes, and snippets.

View dmitrykolesnikovich's full-sized avatar

Dmitry Kolesnikovich dmitrykolesnikovich

  • AdChamp
  • Minsk, Belarus
  • 06:27 (UTC +03:00)
View GitHub Profile
@adavis
adavis / ChipsView.kt
Last active March 26, 2024 02:00
A function to programmatically add views to ConstraintLayout with Flow
class ChipsView<T : Parcelable>(ctx: Context, attr: AttributeSet) : ConstraintLayout(ctx, attr) {
...
private fun addSubviews() {
val flow = Flow(context).apply {
id = generateViewId()
setWrapMode(Flow.WRAP_CHAIN)
setHorizontalStyle(Flow.CHAIN_PACKED)
setHorizontalAlign(Flow.HORIZONTAL_ALIGN_START)
setHorizontalBias(0f)
@mlfarrell
mlfarrell / CollDetect.cpp
Last active September 27, 2024 14:13
Vertical (Wall) Coll Detect
/*** Not optimized or perfect, but hopefully helps someone else learn **/
//https://gamedev.stackexchange.com/questions/96459/fast-ray-sphere-collision-code
static bool intersectRaySegmentSphere(float3 o, float3 d, float3 so, float radius2, float3 &ip)
{
//we pass in d non-normalized to keep it's length
//then we use that length later to compare the intersection point to make sure
//we're within the actual ray segment
float l = d.length();
d /= l;
@LouisCAD
LouisCAD / !README.md
Created February 28, 2019 11:31 — forked from Ribesg/!README.md
How to use an iOS Framework in a Kotlin MPP library published to Maven

This gist demonstrates how to build a Kotlin MPP library so that the iOS sourceSet depends on and uses an iOS Framework as a dependency.

Key ideas:

  • We use [Carthage] to retrieve/build the iOS Framework.
  • We use [cinterop] to create bindings allowing us to use the iOS Framework from Kotlin
  • We build and publish the library using ./gradlew publishToMavenLocal
  • We build and publish [klib] artifacts for both the arm64 and x86_64 architectures, you can easily add arm32 if you need.
  • Note that the publish process also publishes a cinterop klib artifact, allowing dependents to also know about the iOS Framework headers.

You can find a gist explaining how to use such library in an iOS app [here][ios-app].

@falkoschumann
falkoschumann / build.gradle
Last active March 14, 2022 11:36
javapackager with Gradle
group 'de.muspellheim'
version '1.0.0'
apply plugin: 'java'
sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
jcenter()
@skabber
skabber / exportOptions.plist
Last active July 5, 2024 18:22
Export Options Plist Example
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>app-store</string>
<key>teamID</key>
<string>XXXXXXXXXX</string>
<key>uploadBitcode</key>
<true/>
@cbeyls
cbeyls / KotlinFunctions.md
Last active August 12, 2024 07:36
Comparison of Kotlin functions: also, apply, let, run, with
Function Function type Target passed as Returns
also Extension it Target
apply Extension this Target
let Extension it Block return value
run Extension this Block return value
with Regular this Block return value
@YukiYoshikawa
YukiYoshikawa / pom.xml
Last active September 23, 2017 12:49
pom.xml for JMH Sample
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sample.jmh</groupId>
<artifactId>trial-jmh</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>JMH benchmark sample: Java</name>
@githubutilities
githubutilities / Apple-real-device-debugging.md
Last active November 18, 2023 12:41
install ipa using command line

Apple Real Devices Debugging

What you need

  • certificate--which tells your devices that Apple trust you
  • a app id
  • a test device
  • a provisioning profile
@Thermionix
Thermionix / userDefineLang_Groovy.xml
Last active October 1, 2024 15:04
Groovy user defined language for notepad++
<NotepadPlus>
<UserLang name="Groovy" ext="groovy" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 04*/ 00// 01 02</Keywords>
<Keywords name="Keywords1">abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true</Keywords>
<Keywords name="Keywords2">as assert def mixin property test using in it</Keywords>
@toddb
toddb / userDefineLang_Gradle.xml
Created June 4, 2012 20:26
Gradle language for Notepad++
<NotepadPlus>
<UserLang name="Gradle" ext="gradle">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="yes" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;&apos;0&quot;&apos;0</Keywords>
<Keywords name="Folder+"></Keywords>