Skip to content

Instantly share code, notes, and snippets.

apply plugin: 'maven-publish'
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
group = 'publishing'
}
publishing {
publications {
package git
import java.io.File
/*
How to use it
- https://raw.githubusercontent.com/erikmd/git-scripts/master/bin/git-format-patch-follow save into your
`/usr/local/bin/git-format-patch-follow` (not .sh suffix) & make it executable
- take following code
- update `patchesFolder`, `libNetworkSource`, `target` accordingly to your case
@jbruchanov
jbruchanov / fix.sh
Created November 12, 2019 13:12
Rename commit author
git filter-branch --env-filter '
WRONG_EMAIL="[email protected]"
NEW_NAME="NewName"
NEW_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
@jbruchanov
jbruchanov / AppDelegate.m
Created January 3, 2020 21:49
UITor - macos
//
// AppDelegate.m
// uitor
//
// Created by Jiri Bruchanov on 03/01/2020.
// Copyright © 2020 Jiri Bruchanov. All rights reserved.
//
//WEB Server https://github.com/swisspol/GCDWebServer
@jbruchanov
jbruchanov / Analytics.kt
Last active January 12, 2020 20:38
Analytics uFramework
package com.kotlin
interface IEventName {
val eventName: String
}
interface IAnalyticsArgsEvent<T> : IEventName
interface IAnalyticsMapArgsEvent : IAnalyticsArgsEvent<Map<String, Any>>
class AnalyticsArgsEvent<T>(override val eventName: String) : IAnalyticsArgsEvent<T>
class AnalyticsMapArgsEvent(override val eventName: String) : IAnalyticsMapArgsEvent
private static def isAndroidApp(Project project) {
return project.plugins.findPlugin("com.android.application") != null
}
private static def isJavaLib(Project project) {
return project.plugins.findPlugin("java-library") != null
}
class ProjectDetails {
ProjectDetails(classDirs, srcDirs, buildDir, testTask) {
@jbruchanov
jbruchanov / event.ics
Created April 6, 2021 09:11
GCalendar, last working day of month
#google calendar -> settings -> import
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1;WKST=MO
SUMMARY:Invoicing
DTSTART;VALUE=DATE:20210430
SEQUENCE:0
DESCRIPTION:Invoicing.
END:VEVENT
?
https://stackoverflow.com/questions/12334468/java-sign-certificate-programmatically-without-bc
https://www.programmersought.com/article/50962351573/
https://github.com/apache/commons-crypto
https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/
#Private CA key
openssl genrsa -des3 -out myCA.key 2048
#Public CA certificate
@jbruchanov
jbruchanov / fft.c
Created February 8, 2022 10:23
FFT-C
#include <stdio.h>
#include <math.h>
#include <time.h>
//algorithm taken from
//https://rosettacode.org/wiki/Fast_Fourier_transform#C
//simplified version to remove double complex numbers dependency to see exactly what the code does
//(N log(N)) - complexity
typedef float fftn;
@jbruchanov
jbruchanov / fft.kt
Last active February 8, 2022 10:39
FFT - Kotlin
@file:Suppress("LocalVariableName")
package com.scurab.neonimpl
import kotlin.math.ceil
import kotlin.math.cos
import kotlin.math.sin
/*
Implementation of https://rosettacode.org/wiki/Fast_Fourier_transform#C