https://github.com/allmarkedup/purl, A JS utility for for parsing URLs and extracting information out of them.
https://github.com/zacharyvoase/urlobject, Python library for manipulating URLs (and some URIs) in a more natural way.
#!/usr/bin/python | |
# Created by C. Bess (2013) | |
# Converts the frame dot notation to CGGeometry function calls | |
# | |
# ref: http://manual.macromates.com/en/environment_variables.html | |
# | |
# Usage: | |
# After selecting the text that contains the target text, use | |
# 'Select Bundle Item' menu item, then find this command and press enter |
# links the Xcode4.6.x 6.1 SDK to Xcode5 sdks | |
# by C. Bess (2013) | |
# For simulators run (ex: iOS 6 sdk/app in iOS 7 simulator): | |
# - Works if you haven't installed iOS 6 sdk yet | |
# ln -s Xcode-4.6.3.app/.../iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk Xcode.app/.../iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk | |
echo Linking iOS 6 SDK to Xcode 5 | |
# name of the Xcode bundles (in Applications) |
/** | |
* Returns the human-readable string that represents the specified seconds. | |
* @discussion Ex: seconds = 4017 -> "01:06:57" | |
*/ | |
- (NSString *)timeStringFromSeconds:(NSInteger)seconds | |
{ | |
int hours = seconds / 3600; | |
int rem = seconds % 3600; | |
int minutes = rem / 60; | |
int remSecs = rem % 60; |
https://github.com/allmarkedup/purl, A JS utility for for parsing URLs and extracting information out of them.
https://github.com/zacharyvoase/urlobject, Python library for manipulating URLs (and some URIs) in a more natural way.
Speed, Quality, Cost... Pick two. |
#!/bin/bash | |
# installs tools and apps for basic dev operations | |
# Created by Christopher Bess (2014) | |
# License: MIT | |
# updated: 2014-02-11 | |
function msg() { | |
echo "> $1" | |
} |
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset | |
{ | |
UICollectionViewFlowLayout *flowLayout = (UICollectionViewFlowLayout*) self.collectionView.collectionViewLayout; | |
// CGFloat maxOffset = (kItemWidth + flowLayout.minimumInteritemSpacing) * kMaxCount; | |
NSInteger item = (targetContentOffset->x / (kItemWidth + flowLayout.minimumInteritemSpacing)); | |
NSIndexPath *targetPath = [NSIndexPath indexPathForItem:item inSection:0]; | |
UICollectionViewLayoutAttributes *attrs = [self.collectionView layoutAttributesForItemAtIndexPath:targetPath]; | |
DebugLog(@"target cell attrs: %@", attrs); |
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath]; | |
// we are placing it above the collection view, in the VC.view, | |
// so convert the rect to that coord. region | |
CGRect cellRect = [collectionView convertRect:cell.frame toView:self.view]; | |
CGRect cellBounds = cell.bounds; | |
// get an image of the cell |
-- open Terminal and do stuff | |
tell application "Terminal" | |
set currentTab to do script ("python") | |
delay 1 | |
do script ("import sys") in currentTab | |
do script ("sys.path") in currentTab | |
delay 1 | |
--close front window |
@interface FNViewController () { | |
BOOL isFlipped; | |
BOOL isTransitioning; | |
CALayer *topLayer; | |
CALayer *bottomLayer; | |
} | |
@property (weak, nonatomic) IBOutlet UIImageView *oneImageView; | |
@property (weak, nonatomic) IBOutlet UIImageView *twoImageView; | |
@property (nonatomic, assign) BOOL displayingFront; |