Skip to content

Instantly share code, notes, and snippets.

View jjthrash's full-sized avatar

Jimmy Thrasher jjthrash

View GitHub Profile
@jjthrash
jjthrash / -
Created November 11, 2013 16:28
Showing the top 20 stories, if you want to show more, specify number with the --number option
#57224320 JT bug started [** ] (build 13) eCat crashes during sync if single price l
#20824535 JT feature started [**** ] Calculate total inventory for an item summing all opt
#52640481 JT feature rejected [*** ] (ipad) Back up everything necessary to restore local
#60029912 JT bug unstarted [ ] (build 12) Product details do not display
#60279350 JT bug unstarted [ ] (build 13) Loading Order Details for a locally create
#60432040 JT bug unstarted [ ] (build 13) The single item view order button text sh
#60431414 JT bug unstarted [ ] (build 13) Add to order w/options button text truncat
@jjthrash
jjthrash / README.md
Last active December 18, 2015 15:39
Dealing with NSURLConnection mystery allocations.

The Problem

Having mystery memory leaks related to NSURLConnection?

One of my clients' projects involves downloading and thumbnailing thousands of images. The basic core of the code is:

for (NSString *key in keys) {
  NSURL *url = [self makeURLForKey:key];
 NSData *data = [NSData dataWithContentsOfURL:url]; // <== this is the line I care about
# File minitest/unit.rb, line 230
def assert_in_delta exp, act, delta = 0.001, msg = nil
n = (exp - act).abs
msg = message(msg) { "Expected #{exp} - #{act} (#{n}) to be < #{delta}" }
assert delta >= n, msg
end
@jjthrash
jjthrash / 0the-problem.md
Last active December 17, 2015 19:49
How to automate the process of properly killing iOS simulator processes

The problem: XCode leaves behind zombie processes

When you click the "stop" button to kill a simulator process in XCode, it leaves behind a zombie process. You'll see something like this:

diannao:options-test (09:04) $ ps -fu jjthrash
…
  501  1503   228   0 Fri09AM ??         0:00.00 (myIOSApp)
…
@jjthrash
jjthrash / everclear-recipe.md
Last active June 19, 2019 20:32
Limoncello recipe to try #personal #recipe

Limoncello

Components

  • 2 bottles of everclear (151 proof)
  • zest of 38 lemons
  • 4.25 cups sugar

Method

@jjthrash
jjthrash / sample_usage.rb
Last active December 11, 2015 06:08
Ruby here docs are funny
irb(main):001:0> def id(string)
irb(main):002:1> string
irb(main):003:1> end
=> nil
irb(main):004:0>
irb(main):005:0* id(<<END).to_i
irb(main):006:1" 314
irb(main):007:1" END
=> 314
@jjthrash
jjthrash / peanut-brittle-recipe.md
Last active August 6, 2018 20:23 — forked from anonymous/recipe.md
Spicy Peanut Brittle Recipe #personal #recipe
  • 1 cup sugar
  • 1/2 cup light corn syrup
  • 1/4 tsp salt
  • 1/4 cup water

Heat until dissolved

  • 1 cup peanuts
  • 1/2 tsp cayenne pepper
@jjthrash
jjthrash / gist:4079031
Created November 15, 2012 14:57
Editing new files as you stage them
# Why? You might want to remove log files, commented code.. generally clean up your
# code before you stage it. You might also want to remove function that isn't ready
# yet in order to keep your commits concise and meaningful.
# stage an empty version of the file so we can git add --patch later
git add -N thefile
# add --patch, so we can tweak the file (via the edit hunk feature) before it's
# staged
git add --patch thefile
@jjthrash
jjthrash / gist:3861615
Created October 9, 2012 21:36
OSX->S3 screenshots
#!/bin/bash
# Install the Deps:
# brew install s3cmd
# s3cmd --configure
#
# Usage:
# <script_name> some-prefix | pbcopy
set -e
class Version
include Comparable
attr_reader :major, :feature_group, :feature, :bugfix
def initialize(version="")
version = "0.0" unless version
v = version.split(".")
@major = v[0].to_i
@feature_group = v[1].to_i