Skip to content

Instantly share code, notes, and snippets.

Daniel Beard daniel-beard

Block or report user

Report or block daniel-beard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am daniel-beard on github.
  • I am danielbeard (https://keybase.io/danielbeard) on keybase.
  • I have a public key ASCfzz_hkm_UsgUzOhyRsT2u77fvk91Z3xCDzbpzsakTNAo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am daniel-beard on github.
  • I am danielbeard (https://keybase.io/danielbeard) on keybase.
  • I have a public key ASBLUxnwRdspFk8a3eow46j_547NLwsZ_l5O88QIkiU-owo

To claim this, I am signing this object:

View commentparser.cpp
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "llvm/Support/CommandLine.h"
#include "clang/Tooling/Tooling.h"
#include <iostream>
using namespace clang::tooling;
View process_xcodebuild_log.rb
#!/usr/bin/env ruby
require 'optparse'
require 'pathname'
require 'json'
# http://danielbeard.io/2016/08/17/swift-file-compile-times.html
# Helper function to parse filename
def parse(input)
result = ""
View uncrustify.log
# Uncrustify 0.64_d
align_oc_msg_colon_span = 1
# option(s) with 'not default' value: 1
#
# -=====-
# Line Tag Parent Columns Br/Lvl/pp Flag Nl Text
# 1> NEWLINE[ NONE][ 1/ 1/ 1/ 0][0/0/0][ 0][1-0]
# 2> OC_SCOPE[ OC_MSG_DECL][ 1/ 1/ 2/ 0][0/0/0][ 100060000][0-0] -
# 2> PAREN_OPEN[ OC_MSG_DECL][ 3/ 3/ 4/ 1][0/0/0][2100040000][0-0] (
# 2> TYPE[ NONE][ 4/ 4/ 8/ 0][0/1/0][2000040000][0-0] void
@daniel-beard
daniel-beard / brancher.sh
Last active Nov 17, 2016
Interactively delete git remote branches
View brancher.sh
#!/bin/bash
# The MIT License (MIT)
# Copyright (c) 2016 Daniel Beard
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT O
View cull_violations_not_in_diff.rb
#!/usr/bin/env ruby
require 'optparse'
require 'pathname'
require 'json'
require 'git_diff_parser'
# This script takes an input .json file in the standard lint format
# and culls violations that do not occur on changed lines for a given diff file.
# Parse command line options.
@daniel-beard
daniel-beard / gist:4516490
Created Jan 12, 2013
Background / Foreground async dispatches ios objective-c
View gist:4516490
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//background processing goes here
dispatch_async(dispatch_get_main_queue(), ^{
//update UI here
});
});
View gist:2fbb361917e96f0be750
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
View UISupressLocationAlert.m
SEL selector = NSSelectorFromString(@"setAuthorizationStatus:forBundleIdentifier:");
NSMethodSignature *methodSignature = [CLLocationManager methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
invocation.selector = selector;
CLAuthorizationStatus status = kCLAuthorizationStatusAuthorizedAlways;
NSString *identifier = @"com.test.testapp";
[invocation setArgument:&status atIndex:2];
[invocation setArgument:&identifier atIndex:3];
You can’t perform that action at this time.