Skip to content

Instantly share code, notes, and snippets.

View alexsorokoletov's full-sized avatar

Alex Sorokoletov alexsorokoletov

View GitHub Profile
@alexsorokoletov
alexsorokoletov / OculusQuest.Mac.Setup.txt
Last active May 18, 2020 03:19
Cheatsheet how to setup Oculus Quest for MacOS
1. https://developer.oculus.com/documentation/unity/unity-enable-device/
2. Remove ~/.android folder before connecting
3. Add vendor to ~/.android/adb_usb.ini (see https://stackoverflow.com/a/7136003/883738)
4. Install QuietCast https://www.reddit.com/r/OculusQuest/comments/c0ub6k/cast_quest_to_a_mac_instructions/ or run manually
```
adb connect 192.168.0.105 && scrcpy --crop 1280:720:100:400 -b4M -m720
```
5. https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022
@alexsorokoletov
alexsorokoletov / FFmpeg.txt
Created May 14, 2020 03:48
ffmpeg commands for compressing video to share in the email
ffmpeg -i input.mp4 -vcodec libx264 -crf 23 output1.mp4
ffmpeg -i input.mp4 -vcodec libx264 -crf 23 -vf "scale=iw/2:ih/2" output2.mp4
@alexsorokoletov
alexsorokoletov / wifi_level.30s.sh
Last active May 24, 2021 19:55
xbar bitbar plugin for wifi speed and name - I use it to find weak wifi spots or confirm that the wifi signal jumps
#!/usr/bin/env bash
# <bitbar.title>WiFi level</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Alex Sorokoletov</bitbar.author>
# <bitbar.author.github>alexsorokoletov</bitbar.author.github>
# <bitbar.desc>TX rate/Link speed of the connected WiFi</bitbar.desc>
# <bitbar.dependencies></bitbar.dependencies>
# <bitbar.abouturl>https://sorokoletov.com/</bitbar.abouturl>
@alexsorokoletov
alexsorokoletov / objc-automatic-log-braintree-utils-4-11-0.txt
Created March 9, 2018 18:25
objc-automatic-log-braintree-utils-4-11-0.txt
sh bind.sh POD=Braintree/PayPalUtils VERBOSE POD_VERSION=4.11.0 ROOT_HEADER_FILE=PayPalUtils.h
Checking Paket version (downloading latest stable)...
Paket.exe 5.148.0 is up to date.
Paket version 5.148.0
Skipping resolver for group Auto since it is already up-to-date
Skipping resolver for group Main since it is already up-to-date
/Users/alex/work/dt/objc-automatic/paket.lock is already up-to-date
Installing into projects:
- Creating model and downloading packages.
Performance:
@alexsorokoletov
alexsorokoletov / tips.md
Created February 2, 2017 23:42
Xamarin Dev Tips (WIP)
  1. Adjust your app for best and faster debugging: do not pop alerts about push notifications registration failure if it's a simulator (you can check it!)

if (ObjCRuntime.Runtime.Arch == ObjCRuntime.Arch.DEVICE)

@alexsorokoletov
alexsorokoletov / Web.config
Created January 23, 2017 15:23
Web.config for Azure App Services/Web Sites to allow downloading static files (withouth extension) for Electron autoupdate
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="." mimeType="text/plain" />
<mimeMap fileExtension=".nupkg" mimeType="application/octet-stream" />
<mimeMap fileExtension=".exe" mimeType="application/octet-stream" />
<mimeMap fileExtension=".zip" mimeType="application/x-zip-compressed" />
</staticContent>
</system.webServer>
W/WhetstoneService(4090): Process { PackageName :de.codenauts.hockeyapp Pid: 8540 Uid: 0 Start by: activity Score:50 Old score:50 state:0 mBackgroundTimeInMillis:1482477503307 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 0 PackageInfo:{WhetstonePackageInfo#PacakgeName:de.codenauts.hockeyappFlag:1073747008 [,TRIMHEAPS,SOFT_RESET,FLAG_DEAL_SCHEDULE] Type:0[] } tasknum:64} not exist!
@alexsorokoletov
alexsorokoletov / buildlog1.txt
Created December 13, 2016 08:52
TestBindingsApp compilation log
Building: FirebaseTestApp (Debug|iPhoneSimulator)
Build started 12/13/2016 3:05:26 AM.
__________________________________________________
Project "/Users/alex/work/dt/Xamarin.Firebase.iOS/FirebaseTestApp/FirebaseTestApp.csproj" (Build target(s)):
Initial Properties:
__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
Apple_PubSub_Socket_Render = /private/tmp/com.apple.launchd.XSllxxC1th/Render
@alexsorokoletov
alexsorokoletov / remove-bin-obj.sh
Last active October 1, 2019 12:13
Clear bin/obj folders for Xamarin projects, as well as other temporary Xamarin files. Developer lifesaver
#!/bin/bash
# based on http://stackoverflow.com/questions/755382/i-want-to-delete-all-bin-and-obj-folders-to-force-all-projects-to-rebuild-everyt
find . -iname "bin" -type d | xargs rm -rf
find . -iname "obj" -type d | xargs rm -rf
# clear VS4Mac temporary downloads
echo ~/Library/Caches/VisualStudio/7.0/TempDownload/
for f in ~/Library/Caches/VisualStudio/7.0/TempDownload/* ; do
sudo rm -rf $f
done
@alexsorokoletov
alexsorokoletov / uwp_image_convert_to_jpeg_quality.cs
Created May 23, 2016 02:03
How to convert image to JPEG and specify quality (q) parameter in UWP C# XAML
/// <summary>
/// Converts source image file to jpeg of defined quality (0.85)
/// </summary>
/// <param name="sourceFile">Source StorageFile</param>
/// <param name="outputFile">Target StorageFile</param>
/// <returns></returns>
private async Task<StorageFile> ConvertImageToJpegAsync(StorageFile sourceFile, StorageFile outputFile)
{
//you can use WinRTXamlToolkit StorageItemExtensions.GetSizeAsync to get file size (if you already plugged this nuget in)
var sourceFileProperties = await sourceFile.GetBasicPropertiesAsync();