Skip to content

Instantly share code, notes, and snippets.

View notjosh's full-sized avatar

Joshua May notjosh

View GitHub Profile
@cjxe
cjxe / 1.md
Last active June 26, 2024 13:56
🍎 MacOS apps that I use regularly

⚠️ DISCLAIMER

My general thumb of rule to download a new tool is to wait until I Google a tool to solve a problem, and then integrate it into my workflow. So download the tools which you think are useful to your workflow.

Productivity

@gbaman
gbaman / HowToOTGFast.md
Last active May 14, 2024 10:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@kccqzy
kccqzy / clean_trash.js
Last active September 12, 2023 06:01
This gist cleans your OS X trash by permanently removing items trashed more than X days ago
#!/usr/bin/env osascript -l JavaScript
var numDaysToKeep = 20;
var now = $.NSDate.date;
console.log("Now:", now.description.js);
var deleteThreshold = now.dateByAddingTimeInterval(-86400 * numDaysToKeep);
console.log("Will delete items whose date added is earlier than", deleteThreshold.description.js);
var urlPath = $.NSURL.alloc.initFileURLWithPathIsDirectory($('~/.Trash').stringByExpandingTildeInPath, true);
var fm = $.NSFileManager.defaultManager;
var urlContents = fm.contentsOfDirectoryAtURLIncludingPropertiesForKeysOptionsError(urlPath, ["NSURLAddedToDirectoryDateKey"], $.NSDirectoryEnumerationSkipsHiddenFiles, null).js;
@adewes
adewes / README.md
Last active February 13, 2024 16:39
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@myell0w
myell0w / BoldDynamicText
Last active January 2, 2016 14:09
Respect the accessibility setting "Bold Text" on iOS7, when implementing Dynamic Type with a custom font.
BOOL MTDIsBoldTextEnabled(void) {
static BOOL boldTextEnabled = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// Hack that checks if the "bold text" flag in the accessibility settings is enabled
UIFont *font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
boldTextEnabled = [font.fontName rangeOfString:@"MediumP4"].location != NSNotFound;
});
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@bsneed
bsneed / SDMacros.h
Last active December 19, 2015 15:59
My simpler reimplementation of @weakify/@strongify.
//
// SDMacros.h
//
// Created by Brandon Sneed on 7/11/13.
// Copyright (c) 2013 SetDirection. All rights reserved.
//
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
#import <Foundation/Foundation.h>
@interface NSArray (SafeAccess)
- (instancetype)withoutNulls;
- (instancetype)arrayByRemovingObjectsOfClass:(id)obj;
- (id)objectAtIndex:(NSUInteger)index ifKindOf:(Class)kind;
- (id)objectAtIndex:(NSUInteger)index ifKindOf:(Class)kind defaultValue:(id)defaultValue;
@phughes
phughes / image.py
Last active March 5, 2023 21:58
An Xcode precompilation script to turn your images into auto-completeable, type-checkable symbols.
import os.path as path
import string
import argparse
import glob
import re
def basename(filename):
base = filename
if filename.find('@2x') > 0:
base = filename[:filename.find('@2x')]