Skip to content

Instantly share code, notes, and snippets.

View dbarden's full-sized avatar

Daniel Barden dbarden

View GitHub Profile
@dbarden
dbarden / json.py
Last active November 21, 2020 06:34
json chisel command
#!/usr/bin/python
# Example file with custom commands, located at /magical/commands/example.py
import lldb
import fbchisellldbbase as fb
def lldbcommands():
return [ JSON() ]
class JSON(fb.FBCommand):
@dbarden
dbarden / strings.rb
Created June 4, 2020 15:05
Small ruby script that reads all the keys in Localizable.strings and make sure that all have the same keys
#!/usr/bin/env ruby
require 'set'
files = `find . -name Localizable.strings`.split("\n")
# Builds a list of keys
keys = Set.new
MATCH_FORMAT = /\"(.*)\"[ ]*=[ ]*\".*\"/
files.each do | file |
{
"type": "IndoorMapBottomSheet",
"content": {
"id": "building-1",
"title": "Gebäude Eins",
"blocks": [
{
"type": "Text",
"text": "Sehr schön!",
"id": "c05d0f9b-b0c2-4e4d-8832-da49e8630d7a"
{
"id": "Boxenstopp",
"title": "Boxenstopp",
"description": "The coffee bar is located in the foyer of the Porsche Museum. You can enjoy a peaceful cup of coffee here or refuel with a quick snack before your visit to the museum.",
"blocks": [
{
"type": "Text",
"text": "NAVIGATE hilft Ihnen sich zurecht zufinden. Klicken Sie hierzu auf den entsprechenden Punkt in der Karte oder wählen Sie aus der unten stehenden Liste direkt aus.",
"id": "1b254825-e8af-4f5c-9434-8f2091c2157c"
},
@dbarden
dbarden / atest.swift
Last active January 25, 2018 14:11 — forked from anonymous/sourcekitten
protocol TestDelegate: class {
}
protocol TestProtocol {
weak var delegate: TestDelegate? { get }
}
class Test {
weak var delegate: TestDelegate
#!/bin/bash
for file in $(find . -name "*imageset" | xargs -IX basename "X" | sed s/".imageset"//); do
grep --exclude-dir=Resources/Assets.xcassets --exclude-dir=Resources/CustomAssets.xcassets -c $file * -R > /dev/null
if [ $? -ne 0 ]
then
echo "Could not create find $file"
fi
done

Simple Docker

- Start mongo docker run --name db mongo
- Kitematic: show container
- Docker hub: mongo, Dockerfile
- Attach
    - docker exec -it --rm db /bin/bash
    - mongo
    - use test, db.items.insert({}), db.items.find()
- From outside
@dbarden
dbarden / list_of_books.md
Last active August 29, 2015 14:25
List of book suggestions
@dbarden
dbarden / gist:4179325e6ea9913abc37
Last active August 29, 2015 14:23
AppCode convert to property refactor

Suppose I have the following scenario

// In my .h

@interface TestClass
@end
@dbarden
dbarden / Carthage_failure
Created March 25, 2015 07:32
Carthage failure
IDEBundleInjection.c: Error 3587 loading bundle '/Users/dbarden/Library/Developer/Xcode/DerivedData/wormhole-aibeploggrzlsdfidrlrpzhkjcxu/Build/Products/Debug-iphonesimulator/wormholeTests.xctest': The bundle “wormholeTests” couldn’t be loaded because it is damaged or missing necessary resources.
DevToolsBundleInjection environment:
XCInjectDiagnostics: (null)
XCInjectBundleInto: /Users/dbarden/Library/Developer/Xcode/DerivedData/wormhole-aibeploggrzlsdfidrlrpzhkjcxu/Build/Products/Debug-iphonesimulator/wormhole.app/wormhole
XCInjectBundle: /Users/dbarden/Library/Developer/Xcode/DerivedData/wormhole-aibeploggrzlsdfidrlrpzhkjcxu/Build/Products/Debug-iphonesimulator/wormholeTests.xctest
TestBundleLocation: /Users/dbarden/Library/Developer/Xcode/DerivedData/wormhole-aibeploggrzlsdfidrlrpzhkjcxu/Build/Products/Debug-iphonesimulator/wormholeTests.xctest
TMPDIR: /Users/dbarden/Library/Developer/CoreSimulator/Devices/3E6E19F3-2D15-4379-A230-EECB57B779F0/data/Containers/Data/Application/E3C37902-7685-4CBE-899B-B7FCA6