Skip to content

Instantly share code, notes, and snippets.

View TheDreamsWind's full-sized avatar

Aleksandr Medvedev TheDreamsWind

  • Russia, St. Petersburg
  • 21:26 (UTC +03:00)
View GitHub Profile
@TheDreamsWind
TheDreamsWind / TDWOperation.h
Created April 16, 2023 07:01
[SO-a/75344837/5690248] An operation class with an arbitrary thread stack size
//
// TDWOperation.h
//
// Created by Aleksandr Medvedev on 16.04.2023.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@TheDreamsWind
TheDreamsWind / TDWView.h
Last active January 12, 2023 13:03
[SO-a/75096664/5690248] Animation class to interpolate custom structure property of a Cocoa class
//
// TDWView.h
//
// Created by Aleksandr Medvedev on 12.01.2023.
//
#import <AppKit/AppKit.h>
typedef struct {
CGFloat location;
@TheDreamsWind
TheDreamsWind / NSObject+TDWHasObserver.h
Last active February 10, 2024 08:48
[SO-a/74386650/5690248] `TDWHasObserver` category leverages private API information to tell whether an object is an existing observer of the instance
//
// NSObject+TDWHasObserver.h
//
// Created by Aleksandr Medvedev on 09.11.2022.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@TheDreamsWind
TheDreamsWind / TDWFTPUploader.h
Created September 25, 2022 19:47
[SO-a/73847407/5690248] `TDWFTPUploader` a helper class to upload files to ftp servers in iOS/macOS
//
// TDWFTPUploader.h
// iOSPlayground
//
// Created by Aleksandr Medvedev on 25.09.2022.
//
@import Foundation;
NS_ASSUME_NONNULL_BEGIN
@TheDreamsWind
TheDreamsWind / main.m
Last active November 23, 2022 21:02
[SO-a/73343830/5690248] An example of lazily named class
//
// main.m
// ObjCPlayground
//
// Created by Aleksandr Medvedev on 04.08.2022.
//
#include <objc/runtime.h>
#include <stdio.h>
@TheDreamsWind
TheDreamsWind / ColorMatrixSubtractFilter.java
Last active August 18, 2022 17:03
[SO-a/53772151/5690248] `GPUImageFilter` with subtract blending function implemented
package the.dreams.wind.blendingfilter;
import android.opengl.GLES20;
import jp.co.cyberagent.android.gpuimage.filter.GPUImageFilter;
class ColorMatrixSubtractFilter extends GPUImageFilter {
private static final String FRAGMENT_SHADER = "precision mediump float;" +
"struct ColorFilter {" +
" mat4 factor;" +
@TheDreamsWind
TheDreamsWind / BlendingFilterRenderer.java
Last active September 1, 2023 17:41
[SO-a/53732051/5690248] GLSurfaceView.Renderer with functionality of subtracting colors via Android ColorFilters
package the.dreams.wind.blendingfilter;
import android.content.Context;
import android.graphics.Bitmap;
import android.opengl.GLES20;
import android.opengl.GLException;
import android.opengl.GLSurfaceView;
import android.opengl.GLUtils;
import android.support.annotation.NonNull;
import android.view.WindowManager;
@TheDreamsWind
TheDreamsWind / expand_layout.xml
Last active November 23, 2022 21:07
[SO-a/53453766/5690248] Android layout with horizontally expandable Constraints
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.constraint.ConstraintLayout