Skip to content

Instantly share code, notes, and snippets.

View mikeumus's full-sized avatar
🪐
ARTEMIS

Michael Duane Mooring mikeumus

🪐
ARTEMIS
View GitHub Profile
@mjrusso
mjrusso / ViewController.swift
Created April 15, 2020 00:01
iPadOS 13.4: ImageCaptureCore's ICCameraFile `requestReadData(atOffset:length:completion:)` always passes empty Data object to completion block
import UIKit
import ImageCaptureCore
import MobileCoreServices
class ViewController: UIViewController {
var deviceFinder = DeviceFinder()
override func viewDidLoad() {
super.viewDidLoad()
@neoneye
neoneye / Logging.swift
Created March 29, 2019 16:16
SwiftyBeaver using Apple's unified logging system (OSLog)
// Copyright © 2019 Simon Strandgaard. All rights reserved.
import SwiftyBeaver
public let log = SwiftyBeaver.self
extension BaseDestination.LevelColor {
mutating func applyDefaultStyle() {
debug = "🏐 "
info = "🏐 "
verbose = "🏐 "
http-server:
host-port: ":5778"
processor:
jaeger-binary:
server-host-port: ":6832"
jaeger-compact:
server-host-port: ":6831"
zipkin-compact:
server-host-port: ":5775"
@mikeumus
mikeumus / gitMe.sh
Last active August 31, 2018 15:43
A script to run on new mahcines to setup git aliases - http://bit.ly/git-me
#!/bin/bash
# Run this script like this:
# curl http://bit.ly/git-me | sh
cat > ~/.gitconfig <<EOF
[user]
name = mikeumus
email = mikeumus@gmail.com
[alias]
co = checkout
@mminer
mminer / MyService.swift
Last active August 6, 2022 05:33
Components of XPC service.
import Foundation
class MyService: NSObject, MyServiceProtocol {
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) {
let response = string.uppercased()
reply(response)
}
}
@mihkels
mihkels / MultiConnectionSupport.java
Created March 2, 2016 13:51
Spring Boot with Letsencrypt SSL certificate support
@Configuration
public class MultiConnectionSupport {
@Value("${server.port}")
private int serverPort;
@Value("${server.http.port}")
private int httpServerPort;
@Bean
public EmbeddedServletContainerFactory servletContainer() {
@mikeumus
mikeumus / posgres-in-c9.md
Last active January 9, 2023 18:39
PostgreSQL in Cloud9 IDE
Gist shortlink: https://git.io/vV0xB

Official Living Doc for Postgres in C9: https://community.c9.io/t/setting-up-postgresql/1573

@mikeumus' Postgres in Cloud9 Notes:
@brock
brock / psql-with-gzip-cheatsheet.sh
Last active April 10, 2024 10:53
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@janmisek
janmisek / gist:63bd49106e27eea771f4
Created May 21, 2015 08:02
Search for value in object
var walked = [];
var searchHaystack = function(haystack, needle, path, exactEquals) {
//dumb truthiness handling
exactEquals = exactEquals ? true : false;
if(typeof haystack != "object") {
console.warn("non-object haystack at " + path.join("."));
return [false, null];
@wenzhixin
wenzhixin / ubuntu14.04-command-line-install-android-sdk
Last active January 16, 2024 21:15
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages