Skip to content

Instantly share code, notes, and snippets.

View MihaelIsaev's full-sized avatar
🎸
working on Swift for Web

Mikhail Isaev aka iMike MihaelIsaev

🎸
working on Swift for Web
View GitHub Profile
@MihaelIsaev
MihaelIsaev / proxy.pac
Created March 26, 2021 11:35 — forked from swinton/proxy.pac
Example proxy.pac, using a SOCKS proxy for certain hosts.
function FindProxyForURL(url, host) {
var useSocks = ["imgur.com"];
for (var i= 0; i < useSocks.length; i++) {
if (shExpMatch(host, useSocks[i])) {
return "SOCKS localhost:9999";
}
}
return "DIRECT";
function getCache(name) {
return new Promise((resolve, reject) => {
const version = 1;
const request = indexedDB.open(name, version);
request.onsuccess = event => {
const db = event.target.result;
/*
* Returns a Promise that resolves with an object
@MihaelIsaev
MihaelIsaev / ARMDebianUbuntu.md
Created September 5, 2020 01:32 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@MihaelIsaev
MihaelIsaev / gist:4015acb7d9e3a937f4ad4c420c50d24f
Created February 2, 2020 23:22 — forked from v-thomp4/gist:951b333a37ee2adb0d3ac557bd75aba4
nginx universal links apple-app-site-association
location = /apple-app-site-association {
proxy_pass http://static.example.com/apple-app-site-association;
proxy_hide_header Content-Type;
add_header Content-Type "application/json";
}
or
location = apple-app-site-association {
default_type application/json;
@MihaelIsaev
MihaelIsaev / multiple_ssh_setting.md
Created January 21, 2020 21:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@MihaelIsaev
MihaelIsaev / CustomIntensityVisualEffectView.swift
Created September 29, 2019 17:02 — forked from darrarski/CustomIntensityVisualEffectView.swift
UIVisualEffectView subclass that allows to customise effect intensity
import UIKit
class CustomIntensityVisualEffectView: UIVisualEffectView {
/// Create visual effect view with given effect and its intensity
///
/// - Parameters:
/// - effect: visual effect, eg UIBlurEffect(style: .dark)
/// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale
init(effect: UIVisualEffect, intensity: CGFloat) {
@MihaelIsaev
MihaelIsaev / Bindings.swift
Created June 14, 2019 02:51 — forked from AliSoftware/Bindings.swift
Re-implementation of @binding and @State (from SwiftUI) myself to better understand it
// This is a re-implementation of the @Binding and @State property wrappers from SwiftUI
// The only purpose of this code is to implement those wrappers myself just to understand how they work internally and why they are needed
// Re-implementing them myself has helped me understand the whole thing better
//: # A Binding is just something that encapsulates getter+setter to a property
@propertyDelegate
struct XBinding<Value> {
var value: Value {
get { return getValue() }
@MihaelIsaev
MihaelIsaev / throttle-SourceKitService
Created February 13, 2017 16:15 — forked from pyrtsa/throttle-SourceKitService
Script to keep SourceKitService from eating up all OS resources
#!/bin/bash
limit="${1-10000000}";
echo "Keeping SourceKitService below $limit KiB of virtual memory."
echo "Hit ^C to quit."
while true; do
sleep 1;
p=`pgrep ^SourceKitService$`
if [ -n "$p" ]; then
vsz=`ps -o vsz -p "$p" | tail -1`
@MihaelIsaev
MihaelIsaev / CountryCodes.json
Last active August 29, 2015 14:20 — forked from aynurin/CountryCodes.json
Remove spaces
{
"countries":[
{
"name":"Afghanistan",
"phoneCode":"93",
"iso":"AF"
},
{
"name":"Albania",
"phoneCode":"355",