Skip to content

Instantly share code, notes, and snippets.

@jrmsklar
jrmsklar / generate_dependency_list.py
Created April 2, 2019 22:35
Script to input a list of npm dependency names and pull relevant information for each one and generate a csv list.
# Script to input a list of npm dependency name and pull relevant information for each one
# and generate a csv list.
import sys
import requests
from bs4 import BeautifulSoup
import pandas
if len(sys.argv) != 3:
print 'Please specify two command line arguments:'
import UIKit
protocol ViewStateType {
var title: String { get set }
init()
}
protocol BaseViewDelegate: class {
associatedtype BaseViewType
@jrmsklar
jrmsklar / dbl.sh
Created July 28, 2018 17:41
Program for deleting git branches locally in Terminal
for branch_name in `git branch --list|sed 's/\*//g'`;
do
printf "\nWould you like to delete \e[33;4m"$branch_name"\033[0m? y for yes, n for no\n"
read answer
if [[ $answer == "y" ]]; then
git branch -D $branch_name
fi
done
// GET /content/order-complete-checks?action=:action&produtId=:productId
// :action - bid-placed|bid-matched|ask-palced|ask-matched|spo-bid-placed
// :productId - product ID
{
"data": [{
"type": "order-complete-checks",
"attributes": {
"requiresManualChecks": true,
@jrmsklar
jrmsklar / NSTimeInterval+HourMinuteSecondString.swift
Created May 4, 2016 15:35
Swift NSTimeInterval extension that formats the time interval into a "X hr Y min" or "X min Y sec" string
//
// NSTimeInterval+HourMinuteSecondString.swift
// Companion
//
// Created by Josh Sklar on 4/26/16.
// Copyright © 2016 Companion. All rights reserved.
//
import Foundation
- (void)someMethodThatDoesATimeIntensiveTaskWithCompletionBlock:(void (^)(void))block
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul), ^{
while (someCondition) {
NSErorr *error;
// Do the time intensive task here, passing the error object along
if (error) {