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
import UIKit
open class LayerView<Layer: CALayer>: UIView {
public final override class var layerClass: Swift.AnyClass {
return Layer.self
}
public final var concreteLayer: Layer {
return layer as! Layer
}
@v-thomp4
v-thomp4 / gist:951b333a37ee2adb0d3ac557bd75aba4
Created April 13, 2017 03:15
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;

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

import Foundation
import UIKit
enum DeviceMaxWidth: Float {
case iPhone4 = 480.0
case iPhone5 = 568.0
case iPhone6 = 667.0
case iPhone6Plus = 736.0
case iPad = 1024.0
case iPadPro = 1366.0
@pyrtsa
pyrtsa / throttle-SourceKitService
Created July 26, 2016 07:46
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`
@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@swinton
swinton / proxy.pac
Created February 11, 2015 02:26
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";
{
"countries":[
{
"name":"Afghanistan",
"phoneCode":"93",
"iso":"AF"
},
{
"name":"Albania",
"phoneCode":"355",
@fadhlirahim
fadhlirahim / installing_supervisor_macosx.md
Last active December 31, 2023 14:45
Setting up supervisord in Mac OS X

Installation

Installing Supervisor on OS X is simple:

sudo pip install supervisor

This assumes you have pip. If you don't:

@Liryna
Liryna / ARMDebianUbuntu.md
Last active May 20, 2024 15:04
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