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
// ---- | |
// Sass (v3.3.8) | |
// Compass (v1.0.0.alpha.19) | |
// ---- | |
div { | |
$myColor: red; | |
color: transparentize($myColor, 0.5); | |
} |
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
// ==UserScript== | |
// @name Stash: PR Overview Build Status | |
// @namespace me.alabor | |
// @include https://mystash/projects/PROJECT/repos/REPOSITORY/pull-requests | |
// @include https://mystash/projects/PROJECT/repos/REPOSITORY/pull-requests?state=open | |
// @version 1 | |
// @grant none | |
// @require http://code.jquery.com/jquery-1.11.2.min.js | |
// ==/UserScript== | |
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
// ==UserScript== | |
// @name Stash: Order PR's | |
// @namespace me.alabor | |
// @include https://mystash/stash/projects/PROJECT/repos/REPOSITORY/pull-requests | |
// @include https://mystash/stash/projects/PROJECT/repos/REPOSITORY/pull-requests?state=open | |
// @version 1 | |
// @grant none | |
// @require http://code.jquery.com/jquery-1.11.2.min.js | |
// ==/UserScript== | |
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
/** | |
* An even more common approach to look for vendor specific implementations in | |
* the browsers javascript object model. | |
* lookUpImplementation(vendors,subject,functionName,replacement) is reusable | |
* for other tasks too :-) | |
*/ | |
var vendors = ['webkit','moz','o','ms']; | |
window.requestAnimationFrame = lookUpImplementation( | |
vendors, window, 'requestAnimationFrame' | |
,function(step) { |
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
NSString* localizedProperty(NSString* propertyName, id fromObject); |
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
// NSArray *colors = @[[UIColor redColor], [UIColor greenColor], [UIColor blueColor]]; | |
// CGFloat locations[] = {0,.5,1}; | |
// DrawVerticalGradient(rect, colors, locations, ctx); | |
void DrawVerticalGradient(CGRect rect, NSArray* colors, const CGFloat steps[], CGContextRef ctx) { | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
NSMutableArray *cgColors = [NSMutableArray arrayWithCapacity:colors.count]; | |
for (UIColor *color in colors) { | |
[cgColors addObject:(__bridge id)(color.CGColor)]; | |
} |
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
CGContextRef CreateBitmapContext(CGSize size) { | |
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef ctx = CGBitmapContextCreate(nil, size.width, size.height, 8, size.width * (CGColorSpaceGetNumberOfComponents(space) + 1), space, kCGImageAlphaPremultipliedLast); | |
CGColorSpaceRelease(space); | |
return ctx; | |
} | |
UIImage* CreateUIImageFromBitmapContext(CGContextRef ctx) { | |
CGImageRef cgImage = CGBitmapContextCreateImage(ctx); |
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 NSArray (ExtractValuesAsArray) | |
/** Creates a new NSArray with the specific value of the items of another array. Ensure that the items of the array are KVC compliant since a key path is used to gather the values. | |
*/ | |
+(NSArray*)arrayWithValuesOfArrayItems:(NSArray*)array keyPath:(NSString*)keyPath; | |
@end |
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
-(BOOL)isCoordinate:(CLLocationCoordinate2D)coordinate insideRegion:(MKCoordinateRegion)region { | |
CLLocationCoordinate2D center = region.center; | |
CLLocationCoordinate2D northWestCorner, southEastCorner; | |
northWestCorner.latitude = center.latitude - (region.span.latitudeDelta / 2.0); | |
northWestCorner.longitude = center.longitude - (region.span.longitudeDelta / 2.0); | |
southEastCorner.latitude = center.latitude + (region.span.latitudeDelta / 2.0); | |
southEastCorner.longitude = center.longitude + (region.span.longitudeDelta / 2.0); | |
return(coordinate.latitude >= northWestCorner.latitude && |
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/sh | |
SABNZBD_CONFIG=/root/.sabnzbd/sabnzbd.ini | |
SABNZBD_HOST=--HOST_ADDRESS-- | |
SABNZBD_PORT=9200 | |
SABNZBD_APIKEY=--YOUR_API_KEY-- | |
CP_PID=/var/run/couchpotato.pid | |
CP_CONFIG=/usr/local/couchpotato.config.ini | |
CP_DATADIR=/root/.couchpotato |
OlderNewer