Skip to content

Instantly share code, notes, and snippets.

View srmds's full-sized avatar
🖖

Steven Ramdas srmds

🖖
View GitHub Profile
@srmds
srmds / replace_soh_separator.py
Last active September 18, 2020 14:07
Replace SOH control character field separator (Hadoop) with semicolon in CSV file
# replace_soh_separator.py
from pathlib import Path
import logging
logger = logging.getLogger(__name__)
if __name__ == "__main__":
"""
@srmds
srmds / locustfile.py
Last active March 8, 2019 18:27
Load testing API with Locust
'''
Simple LocustIO testing script to call an API endpoint
********************************** Installation instructions **************************************
Prerequisites
- python 2.7 / 3
- pip, see: https://pip.pypa.io/en/stable/installing/
- locust, see: https://locust.io
@srmds
srmds / gist:b93d4381c370258e87e50b87f7fd17df
Created November 6, 2018 13:05
Delete all timemachine localsnapshots
for date in $(tmutil listlocalsnapshots / | perl -pe 's/com.*(2018.*)/\1/'); do echo "deleting $date"; sudo tmutil deletelocalsnapshots "$date"; done
@srmds
srmds / Installing wkhtmltopdf 0.12.6, 0.12.5, 0.12.4 - Ubuntu 22.06 , 18.04, 16.04 x64, 0.12.6 - MacOS Ventura 13.6.md
Last active November 19, 2024 09:59
Installing wkhtmltopdf 0.12.4, 0.12.5 0.12.6 - Ubuntu 22.04 - 0.12.6, 16.04 x64, 0.12.5 - Ubuntu 18.04 x64 - 0.12.5 - macOS Ventura -13.6
@srmds
srmds / Bare Android SDK Setup MacOS.md
Last active November 21, 2017 01:35 — forked from patrickhammond/android_instructions.md
Bare Android sdk setup MacOS
@srmds
srmds / TimeFormatter.swift
Created November 28, 2016 13:33
TimeFormatter Swift 3.0 - Convert milliseconds to a formatted output string of hours:minutes:seconds with applied padding
//
// TimeFormatter.swift
//
// Convert milliseconds to a formatted output string containing hours:minutes:seconds
// with padding zero.
//
// Created by srmds on 28/11/16.
// Copyright © 2015 srmds. All rights reserved.
//
import Foundation
@srmds
srmds / AsyncFetchRequest.swift
Created October 2, 2015 14:01
Swift 2.0 Asynchronous Fetch Request
func getAllEvents(sortedByDate:Bool = false, sortAscending:Bool = true) -> Array<Event> {
print("getAllEvents")
var fetchedResults:Array<Event> = Array<Event>()
let minionManagedObjectContextWorker:NSManagedObjectContext = NSManagedObjectContext.init(concurrencyType: NSManagedObjectContextConcurrencyType.PrivateQueueConcurrencyType)
minionManagedObjectContextWorker.parentContext = self.mainContextInstance
let fetchRequest = NSFetchRequest()
let entity = NSEntityDescription.entityForName("Event", inManagedObjectContext: minionManagedObjectContextWorker)
@srmds
srmds / DateFormatter.swift
Created October 2, 2015 13:57
Swift 2.0 DateFormatter - Parse NSDate to a formatted String, Parse String to a formatted NSDate object
//
// DateFormatter.swift
// CoreDataCRUD
//
// Created by c0d3r on 01/10/15.
// Copyright © 2015 io pandacode. All rights reserved.
//
import Foundation
@srmds
srmds / TimeFormatter.swift
Last active March 2, 2020 21:32
TimeFormatter Swift 2.0 - Convert milliseconds to a formatted output string of hours:minutes:seconds with applied padding
//
// TimeFormatter.swift
// ElectroDeluxe-Swift2.0
//
// Convert milliseconds to a formatted output string containing hours:minutes:seconds
// with padding zero.
//
// Created by c0d3r on 21/08/15.
// Copyright © 2015 srmds. All rights reserved.
//
@srmds
srmds / TimeFormatter.h
Last active September 4, 2015 13:21
Obj-C - Convert milliseconds to a formatted output string of hours:minutes:seconds with applied padding
//
// TimeFormatter.h
// ElectroDeluxe
//
// Convert milliseconds to a formatted output string containing hours:minutes:seconds
// with padding zero.
//
// Copyright © 2015 srmds. All rights reserved.
//