Skip to content

Instantly share code, notes, and snippets.

View alexsorokoletov's full-sized avatar

Alex Sorokoletov alexsorokoletov

View GitHub Profile
@RandyMcMillan
RandyMcMillan / macos_disable_airplay.sh
Last active September 8, 2023 20:31
MacOS: toggle "AirPlay Receiver" in "System Preferences" pane id "com.apple.preferences.sharing"
#!/bin/bash
osascript <<EOS
on toggle()
tell application "System Preferences" to reveal pane id "com.apple.preferences.sharing"
tell application "System Events" to tell window 1 of application process "System Preferences"
repeat until exists checkbox 1 of (first row of table 1 of scroll area 1 of group 1 whose value of static text 1 is "AirPlay Receiver")
@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 / 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>
@mattes
mattes / default.conf
Last active June 4, 2022 06:43
redash.io setup
upstream redash {
server redash:5000;
}
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
@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
@JonDouglas
JonDouglas / xamarinandroidbindings.md
Last active September 8, 2024 20:45
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@gtallen1187
gtallen1187 / scar_tissue.md
Created November 1, 2015 23:53
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation