Skip to content

Instantly share code, notes, and snippets.

View andyzaharia's full-sized avatar

Zaharia Andrei andyzaharia

  • Chisinau, Moldova
View GitHub Profile
CIAdditionCompositing - Adds color components to achieve a brightening effect. This filter is typically used to add highlights and lens flare effects.
CIAffineClamp - Performs an affine transform on a source image and then clamps the pixels at the edge of the transformed image, extending them outwards. This filter performs similarly to the CIAffineTransform filter except that it produces an image with infinite extent. You can use this filter when you need to blur an image but you want to avoid a soft, black fringe along the edges.
CIAffineTile - Applies an affine transform to an image and then tiles the transformed image.
CIAffineTransform - Applies an affine transform to an image. You can scale, translate, or rotate the input image. You can also apply a combination of these operations.
CIAreaAverage - Calculates the average color for the specified area in an image, returning the result in a pixel.
CIAreaHistogram - Calculates a histogram for the specified area in an image, returning the result in a 1D image.
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@CodaFi
CodaFi / alltheflags.md
Last active June 2, 2024 17:09
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
#!/bin/bash
#
# Faster toolchain build: skips as much as possible.
#
# To use this toolchain from the command line:"
# export TOOLCHAINS=$(whoami)
#
# we build to the same prefix every time (instead of building
# to a versioned prefix) because every time the prefix changes
# *everything* rebuilds.
@ha1f
ha1f / CIFilter+Extension.swift
Last active February 20, 2024 08:14
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@smellman
smellman / my_postgre.conf
Last active September 20, 2023 22:47
OpenMapTiles 差分アップデート
listen_addresses = '*'
# Tuning at: https://pgtune.leopard.in.ua/
# DB Version: 9.6
# OS Type: linux
# DB Type: dw
# Total Memory (RAM): 16 GB
# CPUs num: 20
# Connections num: 100
# Hard drive type: ssd
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active June 27, 2024 10:27
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@eugenebokhan
eugenebokhan / CGImage+Resize.swift
Last active April 11, 2024 21:28
UIImage + Resize
import CoreGraphics
import Accelerate
import CoreImage
import UIKit
extension CGImage {
public enum Error: Swift.Error {
case imageResizingFailed
case cgContextCreationFailed
@lcrilly
lcrilly / README.md
Last active October 16, 2021 13:11
Workshop: Deploying NGINX as an API Gateway

Workshop: Deploying NGINX as an API Gateway

NGINX is the world’s number one API gateway, delivering the vast majority of today’s API traffic, deployed as standalone gateways or embedded in API management products. This workshop is about deploying NGINX as a lightweight API gateway in a way that supports long-term maintenance and can be automated with common DevOps tooling.

In this hands-on workshop, you will configure NGINX to perform the common API gateway functions of request routing, rate limiting, and authentication for multiple APIs. We will also touch on advanced use cases such as HTTP method enforcement, and JSON validation.

Previous experience of NGINX is valuable, but not essential. Technical requirements:

  • Mandatory: laptop with internet connection
  • Highly recommended: clean installation of NGINX (minimum 1.14.0) - limited assistance for this task will be available at the workshop
@joevt
joevt / EDIDUtil.sh
Last active January 14, 2024 16:48
A set of shell functions used to view and edit EDIDs.
#!/bin/bash
#!/bin/zsh
# by joevt May 24/2023
#=========================================================================================
edid_decode=edid-decode
#=========================================================================================
# Modify EDID