Skip to content

Instantly share code, notes, and snippets.

View mrdavey's full-sized avatar
🙃
Exploring

David Truong mrdavey

🙃
Exploring
View GitHub Profile
@hrkrshnn
hrkrshnn / generic.org
Last active April 21, 2024 01:51
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@emiellensink
emiellensink / UIControl+dynamicType.swift
Created July 7, 2017 14:54
UIControl+dynamicType.swift
//
// UIControl+dynamicType.swift
//
// Created by Emiel Lensink | The Mobile Company on 28/06/2017.
// Copyright © 2017 The Mobile Company. All rights reserved.
//
import UIKit
extension UILabel {
@gunhansancar
gunhansancar / VisualEffectViewExtensions.swift
Created February 16, 2017 13:49
In this gist you can find out how to fade in/fade out UIBlurEffect on UIVisualEffectView on iOS 10 and also earlier versions. Also added example ViewController to see how to use them in action. The below snippets are written in Swift3.
extension UIVisualEffectView {
func fadeInEffect(_ style:UIBlurEffectStyle = .light, withDuration duration: TimeInterval = 1.0) {
if #available(iOS 10.0, *) {
let animator = UIViewPropertyAnimator(duration: duration, curve: .easeIn) {
self.effect = UIBlurEffect(style: style)
}
animator.startAnimation()
}else {
@hujunfeng
hujunfeng / udid-faq.md
Last active January 24, 2024 14:15
UDID, identifierForVendor and advertisingIdentifier FAQ

What's the difference between UUID, GUID and UDID?

  • UUID (Universally Unique Identifier): A sequence of 128 bits that can guarantee uniqueness across space and time, defined by [RFC 4122][rfc4122].

  • GUID (Globally Unique Identifier): Microsoft's implementation of the UUID specification; often used interchangeably with UUID.

  • UDID _(Unique Device Identifier)): A sequence of 40 hexadecimal characters that uniquely identify an iOS device (the device's Social Security Number, if you will). This value can be retrieved through iTunes, or found using UIDevice -uniqueIdentifier. Derived from hardware details like MAC address.

Is UDID deprecated?

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: