Skip to content

Instantly share code, notes, and snippets.

@jonathan-beebe
jonathan-beebe / index.html
Created December 14, 2012 15:55
Leaflet.js - Mark Radius
<!doctype html>
<html>
<head>
<title>Leaflet.js - Mark Radius</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.ie.css" /><![endif]-->
<link rel="stylesheet" href="styles.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
@jonathan-beebe
jonathan-beebe / bpd.md
Last active February 18, 2020 13:18
Notes on Borderline Personality Disorder (BPD)

Borderline Personality Disorder (BPD)

9 Traits

  1. Fear of Abandonment
  2. Idealization & Devaluation, Unstable Relationships
  3. Unstable Identity
  4. Emotional Void, Emptiness
  5. Impulsive, Self Destructive
  6. Suicidal, Self Harm
@jonathan-beebe
jonathan-beebe / custom_json_parsing.swift
Last active June 19, 2019 16:46
Customize json parsing of a Swift Decodable
// https://gist.github.com/jonathan-beebe/a631492c6589b14d0c06fe846d266ff7
import UIKit
// The vendor sandbox returns the following values for an `undefined` string value:
//
// - `""`
// - `"None"`
// - `null`
//
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
interface IRessetable
{
void Reset();
}
@jonathan-beebe
jonathan-beebe / eisenhower_matrix.md
Created March 12, 2019 14:55
Eisenhower Matrix
                       Urgent               Not Urgent
               ┌─────────────────────┬─────────────────────┐
               │                     │                     │
               │                     │                     │
     Important │      Do First       │      Do Later       │
               │                     │                     │
               │                     │                     │
               ├─────────────────────┼─────────────────────┤

│ │ │

@jonathan-beebe
jonathan-beebe / gist:34e5c0815c17c063f3c211f288fe871d
Created March 12, 2019 13:47
Software Engineering Quadrants
┌──────────────────────────┬──────────────────────────┐
Complex │┌───────────┐ │ ┌───────────┐│
││ Engineer │ │ │ Architect ││
▲ │└───────────┘ │ └───────────┘│
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
@jonathan-beebe
jonathan-beebe / clean_old_code_simulators.sh
Last active February 12, 2019 19:40
Clean out unused Xcode Simulators
# Close Xcode & the iOS Simulator
# http://stackoverflow.com/a/30940055
# Remove any old runtimes from this directory.
cd /Library/Developer/CoreSimulator/Profiles/Runtimes
# e.g.
sudo rm -rf iOS\ 8.1.simruntime
# http://stackoverflow.com/a/11790983
# Remove the download receipts for simulators you don't need anymore.
@jonathan-beebe
jonathan-beebe / ruby-rails-erb-comments.erb
Created February 20, 2014 19:06
Comment lines in ruby rails html.erb files, as answered on StackOverflow http://stackoverflow.com/a/3901665/123781
To comment a single line use
<%-# commented line -%>
This also works
<%# my comment %>
To comment a whole block use a if false to surrond your code like this
@jonathan-beebe
jonathan-beebe / swift-to-objc-bool-bridge.m
Created December 22, 2016 15:41
Bridging an optional bool from Swift to Objective-C
@implementation MyObjcClass
. . .
if(mySwiftClassInstance.hasFeatureBridged == nil) {
// handle nil case
}
else if(mySwiftClassInstance.hasFeatureBridged boolValue] == YES) {
// handle true case
}
@jonathan-beebe
jonathan-beebe / NSString+isNumeric.h
Created February 15, 2013 19:09
Check if an NSString is numeric and/or contains only numeric characters. Inspired by StackOverflow http://stackoverflow.com/questions/6644004/how-to-check-if-nsstring-is-numeric
// Inspired by StackOverflow
// http://stackoverflow.com/questions/6644004/how-to-check-if-nsstring-is-numeric
#import <Foundation/Foundation.h>
@interface NSString (isNumeric)
- (BOOL) isAllDigits;
- (BOOL) isNumeric;