This was tested on:
- Ubuntu 14.04 x64
- Ubuntu 16.04 x64
#!/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` |
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 |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
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; |
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 | |
} |
var fs = require('fs'); | |
var crypto = require('crypto'); | |
fs.readFile('file.pdf', function(err, data) { | |
var checksum = generateChecksum(data); | |
console.log(checksum); | |
}); | |
function generateChecksum(str, algorithm, encoding) { | |
return crypto |
import UIKit | |
import SnapKit | |
class ViewController: UIViewController { | |
var scrollView: UIScrollView! | |
var stackView: UIStackView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
#!/usr/bin/env ruby | |
require 'xcodeproj' | |
project_path = ARGV[0] | |
project = Xcodeproj::Project.open(project_path) | |
project.targets.each do |target| | |
# suppress warnings | |
if [ | |
"Configs", |
/** | |
* Module dependencies. | |
*/ | |
var browserSync = require('browser-sync').create() | |
var proxy = require('http-proxy-middleware') // require('http-proxy-middleware'); | |
/** | |
* Configure proxy middleware | |
*/ | |
var jsonPlaceholderProxy = proxy('/api', { |