Skip to content

Instantly share code, notes, and snippets.

View nil-biribiri's full-sized avatar

NilNilNil nil-biribiri

  • Agoda
  • Bangkok
View GitHub Profile
@prideout
prideout / console.js
Last active March 3, 2021 04:23
github display rich diff everywhere
// clock all <button> with aria-label="Display the rich diff"
buttons = [].filter.call(
document.getElementsByTagName('button'),
el => el.getAttribute('aria-label') == "Display the rich diff");
buttons.forEach(el => el.click())
@shaps80
shaps80 / 1. UserDefaults+Key.swift
Last active September 25, 2020 08:29
Adds a Swift extension to make UserDefaults more consistent to work with.
//
// UserDefaults.swift
//
// Created by Shaps Benkau on 24/05/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
//
import Foundation
#if os(iOS)
@pffan91
pffan91 / NetworkLayerWithMoya_fullExample.swift
Last active February 7, 2019 12:46
NetworkLayerWithMoya_fullExample
#1 Moya Target
import Foundation
import Moya
enum MyAPI {
// MARK: - User
case createUser(model: User)
case changePassword(currentPassword: String, newPassword: String)
import UIKit
extension UIImage {
// colorize image with given tint color
// this is similar to Photoshop's "Color" layer blend mode
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved
// white will stay white and black will stay black as the lightness of the image is preserved
func tint(tintColor: UIColor) -> UIImage {
@insidegui
insidegui / WebCacheCleaner.swift
Created September 14, 2016 23:12
Clear WKWebView's cookies and website data storage, very useful during development.
import Foundation
import WebKit
final class WebCacheCleaner {
class func clean() {
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)
print("[WebCacheCleaner] All cookies deleted")
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 24, 2024 19:36
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k