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
$("a[href*='magnet']").map(function() {return this.href}).get().join("\n") |
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
<script> | |
/*! | |
*** prettyPre ***/ | |
(function( $ ) { | |
$.fn.prettyPre = function( method ) { | |
var defaults = { | |
ignoreExpression: /\s/ // what should be ignored? |
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
[\x{4e00}-\x{9fa5}] // used for match Chinese character | 用来匹配中文 |
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
//| ---------------------------------------------------------------------------- | |
// Called when the view is about to be displayed. May be called more than | |
// once. | |
// | |
- (void)willMoveToWindow:(UIWindow *)newWindow { | |
// Use the layer shadow to draw a one pixel hairline under this view. | |
[self.layer setShadowOffset:CGSizeMake(0, 1.0f/UIScreen.mainScreen.scale)]; | |
[self.layer setShadowRadius:0]; | |
// UINavigationBar's hairline is adaptive, its properties change with |
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
// | |
// SpacemanBlocks.h | |
// | |
// Created by Jerry Jones on 12/11/11. | |
// Copyright (c) 2011 Spaceman Labs. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
typedef void(^SMDelayedBlockHandle)(BOOL cancel); |
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
- (UIImage *)compressImage:(UIImage *)image{ | |
float actualHeight = image.size.height; | |
float actualWidth = image.size.width; | |
float maxHeight = 600.0; | |
float maxWidth = 800.0; | |
float imgRatio = actualWidth/actualHeight; | |
float maxRatio = maxWidth/maxHeight; | |
float compressionQuality = 0.5;//50 percent compression | |
if (actualHeight > maxHeight || actualWidth > maxWidth) { |
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
@interface ViewController () | |
@property (strong, nonatomic) UIScrollView* vScrollView; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
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
import re | |
import urllib2 | |
s = urllib2.urlopen("https://developer.apple.com/videos/wwdc/2014/").read() | |
match = re.findall(r'http://devstreaming.apple.com/[\w/\d\.-]+hd[\w/\d\.]+mov\?dl=1', s) | |
print '\n'.join(match) |
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
#!/bin/bash | |
directoryName="$1" | |
extension="$2" | |
regex='.+' | |
if ! [[ $extension =~ $regex ]]; then | |
echo "Usage: changeExtension directory newExtension"; | |
exit 1; | |
fi |
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
/* | |
* armv7sconvert <infile> <outfile> | |
* Switches CPU subsystem type to armv7s | |
* | |
* By Matt Galloway - http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/ | |
* | |
* Based on g3spot.c from http://redbutton.sourceforge.net (c) Simon Kilvington, 2009 | |
*/ | |
#include <stdio.h> |
NewerOlder