Skip to content

Instantly share code, notes, and snippets.

@mumer92
mumer92 / HookedSession.swift
Created September 24, 2022 09:37 — forked from buranmert/HookedSession.swift
Adding hooks to URLSession
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-2020 Datadog, Inc.
*/
import Foundation
public extension URLSession {
internal typealias RequestInterceptor = HookedSession.RequestInterceptor
import UIKit
extension UITextField {
/// Add a trailing placeholder label that tracks the text as it changes
func addTrailingPlaceholder(_ placeholder: String) {
let label = UILabel()
label.text = placeholder
label.alpha = 0.3
label.isHidden = true
addSubview(label)
@mumer92
mumer92 / Locale+SFSymbol.swift
Created September 9, 2021 10:19 — forked from christianselig/Locale+SFSymbol.swift
Returns an SF Symbol currency image that match's the device's current locale, for instance dollar in North America, Indian rupee in India, etc.
extension Locale {
/// Returns an SF Symbol currency image that match's the device's current locale, for instance dollar in North America, Indian rupee in India, etc.
func currencySFSymbol(filled: Bool, withConfiguration configuration: UIImage.Configuration? = nil) -> UIImage {
// Default currency symbol will be the Animal Crossing Leaf coin 􁂬 to remain impartial to any specific country
let defaultSymbol = UIImage(systemName: "leaf.circle\(filled ? ".fill" : "")")!
guard let currencySymbolName = currencySymbolNameForSFSymbols() else { return defaultSymbol }
let systemName = "\(currencySymbolName).circle\(filled ? ".fill" : "")"
return UIImage(systemName: systemName, withConfiguration: configuration) ?? defaultSymbol
@mumer92
mumer92 / .travis.yml
Created March 5, 2020 10:11 — forked from aterribili/.travis.yml
iOS + Travis + Fastlane continuous delivery
language: objective-c
os: osx
xcode_workspace: {workspace-name}.xcworkspace
xcode_scheme: {workspace-name}
xcode_sdk: iphonesimulator9.0
osx_image: xcode8
before_install:
- |
brew update
gem install xcpretty -N --no-ri --no-doc
@mumer92
mumer92 / plink-plonk.js
Created February 15, 2020 09:54 — forked from tomhicks/plink-plonk.js
Listen to your web pages
//
// WatchSessionManager.swift
// WatchConnectivityDemo
//
// Created by Natasha Murashev on 9/3/15.
// Copyright © 2015 NatashaTheRobot. All rights reserved.
//
import WatchConnectivity
@mumer92
mumer92 / ocr.markdown
Created July 25, 2016 12:04 — forked from henrik/ocr.markdown
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@mumer92
mumer92 / install.sh
Created July 23, 2016 21:41 — forked from ewnd9/install.sh
google's deepdream ubuntu installation
# sources
# http://www.scipy.org/install.html
# http://sohliloquies.blogspot.ru/2015/07/setting-up-deep-dream-google-researchs.html
# https://github.com/BVLC/caffe/wiki/Ubuntu-14.04-VirtualBox-VM
# ~2gb dependencies
mkdir deep-dream && cd deep-dream
sudo apt-get install subversion cmake
import org.apache.commons.net.ftp.*
import java.io.InputStream
import java.io.ByteArrayInputStream
String ftphost = "127.0.0.1"
String ftpuser = "test"
String ftppwd = "test"
int ftpport = 21
@mumer92
mumer92 / GraphicGlDemoActivity.java
Created October 23, 2015 17:36 — forked from ybakos/GraphicGlDemoActivity.java
A simple example of using an Android Renderer to illustrate OpenGL ES boilerplate.
/* GraphicGlDemoActivity.java
* Author: Yong Bakos
* Since: 11/26/2012
* Thanks to:
* Cube: http://intransitione.com/blog/create-a-spinning-cube-with-opengl-es-and-android/
* OpenGL Boilerplate: http://www.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/
*/
package com.humanoriented.sudoku;
import java.nio.ByteBuffer;