Skip to content

Instantly share code, notes, and snippets.

View asfdfdfd's full-sized avatar

Andrey Panchenko asfdfdfd

View GitHub Profile
inline fun <reified T : Any> setPropertyWithReflection(target: T, propertyName: String, propertyValue: Any) {
val namespaceMemberProperty = T::class.memberProperties
.filter { it.visibility == KVisibility.PUBLIC }
.filterIsInstance<KMutableProperty<*>>()
.firstOrNull { it.name == propertyName }
if (namespaceMemberProperty == null) {
throw NullPointerException("Failed to find '$propertyName' at '$target'.")
}
@asfdfdfd
asfdfdfd / 4poziciibruno_for_beginners.txt
Last active December 18, 2022 20:30
Я — не автор этой подборки. Файл был взят где-то в интернетах и выложен сюда для собственного удобства.
4 ПОЗИЦИИ БРУНО: ПОСОБИЕ ДЛЯ НАЧИНАЮЩИХ
------ инструменталы:
/ короткие
2003 [ВАЛЬПУР 018] Сказы Пажопе II (2011) | жёсткий индастриал-нойз
2008 [ВАЛЬПУР 007] Ты и двое молодых | лучший релиз №1: идеальная поп-форма
/ длинные
using System.Collections;
using System.Collections.Generic;
using Nrjwolf.Tools.AttachAttributes; // https://github.com/Nrjwolf/unity-auto-attach-component-attributes
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TextMeshProUGUI))]
public class TextMeshProTeletypeEffect : MonoBehaviour
{
[GetComponent] [SerializeField] private TextMeshProUGUI m_TextMeshProUGUI;
@asfdfdfd
asfdfdfd / Live2DCubismCore.def
Created October 2, 2018 09:02
'def' file for Live2DCubismCore.dll
LIBRARY Live2DCubismCore
EXPORTS
csmGetDrawableConstantFlags
csmGetDrawableCount
csmGetDrawableDrawOrders
csmGetDrawableDynamicFlags
csmGetDrawableIds
csmGetDrawableIndexCounts
csmGetDrawableIndices
csmGetDrawableMaskCounts
@asfdfdfd
asfdfdfd / CameraPreviewSizeUtils.java
Created April 26, 2017 17:07
Quick and dirty version of correct preview size selector.
package com.mirrorai.app.utils;
import android.hardware.Camera;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.SortedMap;
xcodebuild -workspace 'WORKSPACE_NAME.xcworkspace' \
-scheme 'SCHEME_NAME' \
-configuration 'Release' \
-sdk iphoneos7.0 CONFIGURATION_BUILD_DIR='OUTPUT_DIRECTORY'
During normal builds, BITCODE_GENERATION_MODE is set to marker, meaning -fembed-bitcode-marker is passed to clang, meaning the bitcode section is created in the binary but has a size of 1.
During archive builds, BITCODE_GENERATION_MODE is set to bitcode, meaning -fembed-bitcode is passed to clang, meaning the bitcode section is created and properly filled.
https://github.com/Carthage/Carthage/issues/535#issuecomment-142772958
#include <stdio.h>
#include <string>
template<typename Arg> const char* type_to_str();
template<typename...> struct VarIterator;
template<typename Head> struct VarIterator<Head>
{
static std::string eval()
@asfdfdfd
asfdfdfd / MegaRasterize.js
Last active July 23, 2021 15:19
Adobe Illustrator CS6 script that rasterizes every GroupItem from the first layer of active document to the separate png file.
function captureImage(fileName, document, clipRect) {
var fileOutput = new File("/tmp/exportpng/" + fileName);
var imageCaptureOptions = new ImageCaptureOptions();
imageCaptureOptions.resolution = 300;
imageCaptureOptions.transparency = true;
document.imageCapture(fileOutput, clipRect, imageCaptureOptions);
}
#import <mach/mach_host.h>
int get_platform_memory_limit()
{
mach_port_t host_port;
mach_msg_type_number_t host_size;
vm_size_t pagesize;
host_port = mach_host_self();
host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);