This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CocoaLumberjack | |
extension DDLogFlag { | |
public var level: String { | |
switch self { | |
case DDLogFlag.error: return "❤️ ERROR" | |
case DDLogFlag.warning: return "💛 WARNING" | |
case DDLogFlag.info: return "💙 INFO" | |
case DDLogFlag.debug: return "💚 DEBUG" | |
case DDLogFlag.verbose: return "💜 VERBOSE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log uploaded on Sunday, November 13, 2022, 12:00:37 PM | |
Loaded mods: | |
Harmony(brrainz.harmony)[mv:1.5.0.0]: 0Harmony(2.2.2), HarmonyMod(1.5.0) | |
Core(Ludeon.RimWorld): (no assemblies) | |
Royalty(Ludeon.RimWorld.Royalty): (no assemblies) | |
Ideology(Ludeon.RimWorld.Ideology): (no assemblies) | |
Biotech(Ludeon.RimWorld.Biotech): (no assemblies) | |
Bionic icons(automatic.bionicicons): BionicIcons(1.0.0) | |
HugsLib(UnlimitedHugs.HugsLib)[ov:10.0.1]: 0Harmony(av:2.2.2,fv:1.2.0.1), HugsLib(av:1.0.0,fv:10.0.1) | |
Better Pawn Control(VouLT.BetterPawnControl)[ov:2.4.1.2]: BetterPawnControl(av:1.9.2,fv:1.0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import getopt | |
import random | |
def main(argv): | |
investigator_type = 'all' | |
full_team = False | |
pick_two = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
extension PrimitiveSequence where TraitType == SingleTrait { | |
public func asMaybe() -> PrimitiveSequence<MaybeTrait, Element> { | |
return self.asObservable().asMaybe() | |
} | |
public func asCompletable() -> PrimitiveSequence<CompletableTrait, Never> { | |
return self.asObservable().flatMap { _ in Observable<Never>.empty() }.asCompletable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
extension ObservableType { | |
func bind<O>(to observers: [O]) -> Disposable where O: ObserverType, Self.E == O.E { | |
let shared = self.share() | |
let disposables = observers.map(shared.bind(to:)) | |
return CompositeDisposable(disposables: disposables) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Name: MySQL_REBUILD_LIVE_SLAVE_from_MASTER | |
# Purpose: Rebuilds live all Databases of a replication SLAVE based on a good running MASTER | |
# This rebuilt action is done without stopping the MASTER MySQL server or even locking the tables | |
# or the destination server (SLAVE) | |
# Syntax: MySQL_REBUILD_LIVE_SLAVE_from_MASTER Master:Port Slave:Port {F|P} | |
# eg. MySQL_REBUILD_LIVE_SLAVE_from_MASTER db1:3306 www1:3306 P | |
# {F|P} - Dump method F) Uses a full temporary dump file method P) Uses the pipe method | |
# Note: In some situation where the databases are very big (GB) the Pipe (P) method might not work well | |
# In these case it is recommended to use the File(F) method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIImage { | |
convenience init?(pdfDocument: CGPDFDocument, pageNumber: Int = 1) { | |
guard let page = pdfDocument.page(at: pageNumber) else { return nil } | |
let size = page.getBoxRect(.mediaBox).size | |
UIGraphicsBeginImageContextWithOptions(size, true, UIScreen.main.scale) | |
let context = UIGraphicsGetCurrentContext()! | |
context.saveGState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Fastlane | |
module Actions | |
class DownloadDevicesAction < Action | |
def self.run(params) | |
require 'spaceship' | |
ship = Spaceship::Portal.login(ENV['DELIVER_USER'], ENV['DELIVER_PASSWORD']) | |
ship.team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) | |
devices = ship.devices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# installs and configures New Relic System Monitoring agent | |
# https://crondev.com/new-relic-server-monitoring-on-elastic-beanstalk/ | |
# requires `AmazonEC2ReadOnlyAccess` policy to get eb environment name | |
# | |
files: | |
"/opt/elasticbeanstalk/get-eb-env-name.py": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def draw_board(board): | |
print(' | |') | |
print(' %s | %s | %s' % (board[1], board[2], board[3])) | |
print(' | |') | |
print('---+---+---') | |
print(' | |') | |
print(' %s | %s | %s' % (board[4], board[5], board[6])) |
NewerOlder