Skip to content

Instantly share code, notes, and snippets.

View MihaelIsaev's full-sized avatar
⌨️
developing Swift for Web

Mikhail Isaev aka iMike MihaelIsaev

⌨️
developing Swift for Web
View GitHub Profile
@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

@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`
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

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@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;
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
}
@zfael
zfael / nodejs.checksum.js
Created June 20, 2017 13:57
NODE.JS - How to generate file's Checksum (CRYPTO)
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()
@siemensikkema
siemensikkema / fixcodeproj.rb
Last active April 15, 2021 14:06
Post processing script for generated vapor Xcode project
#!/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",
@mygoare
mygoare / proxy.js
Created November 11, 2017 03:38
http-proxy-middleware use with browser-sync gulp
/**
* 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', {