This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); | |
echo "git-rbranch: Creating local branch $1" | |
git checkout -b $1 # make the branch locally | |
echo "git-rbranch: Pushing $1 to the server" | |
git push origin $1 #push it to the server | |
echo "git-rbranch: Checking out $CURRENT_BRANCH again" | |
git checkout $CURRENT_BRANCH # switch to $1 | |
echo "git-rbranch: Setting origin/$1 as the tracking branch" | |
git branch -f $1 origin/$1 # branch to $1, using origin/$1 as the tracking branch | |
echo "git-rbranch: Checking out $1 with the right origin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tempFile='/eraseme/git-commit-template' | |
git config commit.template "$tempFile" | |
rm $tempFile | |
branch=$(git symbolic-ref HEAD|sed s#refs/heads/##) exec 3<> "$tempFile" && awk -v TEXT="$branch" 'BEGIN {print TEXT}{print}' "$tempFile" >&3 | |
git add . | |
git commit -a | |
read -p "Press enter to push to server..." | |
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let percent = 0.3 | |
layout(red, green) { red, green in | |
red.center == red.superview!.center | |
red.size == red.superview!.size | |
green.center == red.superview!.center | |
// lower priority | |
green.width == red.width * percent ~ 100 | |
green.height == red.height * percent ~ 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Dan Rosenstark on 2/28/15. | |
// Copyright (c) 2015 Confusion Studios LLC. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface DRTabBarController : UIViewController <UITabBarDelegate>; | |
@property (nonatomic, strong) NSArray *viewControllers; | |
@property (nonatomic, strong) UITabBar *tabBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ObjectOrString { | |
case Object(NSObject) | |
case Text(String) | |
case Empty | |
func object() -> NSObject? { | |
switch self { | |
case let .Object(obj): return obj | |
default: return nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="margin-left: auto; width: 150px; border:3px solid black; padding: 10px; text-align: center; background-color: #d3d3d3"> | |
Put some stuff in here | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this could be a global formatter available to these other two | |
let formatter = NSDateFormatter(); | |
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss ZZZ"; | |
// since we lose something going to string and back, this does both passes for the current date/time | |
func now() -> NSDate { | |
return stringToDate(dateToString(NSDate())) | |
} | |
func dateToString(date:NSDate) -> String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
# everwatch.rb by Brett Terpstra, 2011 | |
# Watch Evernote for updates and put the current content of the editor into a preview file for Marked.app | |
# <http://markedapp.com> | |
# Modified by dan@rosenstark.com, 2015-08-24, Evernote 6.0.16 | |
# TO LAUNCH USE (if in ~/scripts): | |
# ~/scripts/everwatch-turbo.rb & | |
require 'digest/sha2' | |
require 'fileutils' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum RingPosition : Int { | |
case None, Outer, Inner | |
// not necessary to do this: case None=0, Outer=1, Inner=2 | |
} | |
#if !TARGET_INTERFACE_BUILDER | |
@IBInspectable var ringPosition : RingPosition = .None | |
#else | |
@IBInspectable var ringPosition : Int = 0 | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* URLs starting with https://workflowy.com/ */ | |
/* hide share buttons */ | |
#share_buttons, | |
#helpButton, | |
#leftGradient, | |
#rightGradient { | |
display:none; | |
} |
OlderNewer