Skip to content

Instantly share code, notes, and snippets.

Config.Schema.API.methods[Config.Schema.API.methods.findIndex(x=>x.method=="messages.readHistory")].params = [{name: "emperor", type: "InputPeer"}, {name: "nmaid", type: "int"}]
@dneprDroid
dneprDroid / conv_test.lua
Created January 6, 2021 14:15
Convolution test - torch
require 'nn'
torch.setdefaulttensortype('torch.FloatTensor')
function test_conv()
local kernel_size = 3
local stride = 1
local padding = 1
local layer = nn.SpatialConvolutionMM(64, 64, kernel_size, kernel_size, stride, stride, padding, padding)
layer.weight:fill(2.2) -- fill weigths with 2.2
@dneprDroid
dneprDroid / BehaviorRelay+Collection.swift
Created May 1, 2020 06:45
BehaviorRelay+Collection.swift
extension BehaviorRelay where Element: RangeReplaceableCollection & MutableCollection, Element.Index == Int {
func append(element: Element.Element) {
var array = self.value
array.append(element)
self.accept(array)
}
func append<S: Sequence>(contentsOf collection: S) where S.Element == Element.Element {
RTCError PeerConnection::SetBitrate(const BitrateSettings& bitrate) {
if (!worker_thread()->IsCurrent()) {
return worker_thread()->Invoke<RTCError>(
RTC_FROM_HERE, [&]() { return SetBitrate(bitrate); });
}
......
# the bottom of podfile ...
$static_framework = ['MZStreamCore']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
@dneprDroid
dneprDroid / Audiotest.mm
Last active March 27, 2020 08:25
Audiotest AudioUnit iOS - sin. sound
#import "Audiotest.h"
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
@interface Audiotest : NSObject {
@public
@dneprDroid
dneprDroid / remove-wiki-brackets.sh
Created March 24, 2020 10:06
remove wiki brackets
cat ./text.txt | sed -e 's/\[[^][]*\]//g'
@dneprDroid
dneprDroid / build_webrtc_ios_fat_framework.sh
Last active December 2, 2020 13:25
build webrtc ios fat framework
gn gen out/Release-universal -args='target_os="ios" target_cpu="x64" additional_target_cpus=["arm", "arm64", "x86"] is_component_build=false is_debug=false ios_enable_code_signing=false'
ninja -C out/Release-universal sdk:framework_objc
@dneprDroid
dneprDroid / tg-read.js
Created March 15, 2020 20:32
tg-read.js
Config.Schema.API.methods[Config.Schema.API.methods.findIndex(x=>x.method=="messages.readHistory")].params = [{name: "emperor", type: "InputPeer"}, {name: "nmaid", type: "int"}]
@dneprDroid
dneprDroid / codesign-verify.sh
Created February 23, 2020 13:01
codesign-verify.sh
codesign -dv --verbose=4 /path/to/app