This file contains hidden or 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
Without reminder: | |
:beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: :beer: | |
:beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: | |
:beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: :beers: |
This file contains hidden or 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
/* DeviceUID.h | |
#import <Foundation/Foundation.h> | |
@interface DeviceUID : NSObject | |
+ (NSString *)uid; | |
@end | |
*/ | |
// Device.m |
This file contains hidden or 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
## | |
# Creates an alias called "git hist" that outputs a nicely formatted git log. | |
# Usage is just like "git log" | |
# Examples: | |
# git hist | |
# git hist -5 | |
# git hist <branch_name> | |
# git hist <tag_name> -10 | |
## | |
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short" |
This file contains hidden or 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
std::wstring StringConverter::StringToWideString(const std::string& s) { | |
int len = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.length(), NULL, 0); | |
std::wstring ws(L"", len); | |
wchar_t* pWSBuf = const_cast<wchar_t*>(ws.c_str()); | |
MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, pWSBuf, len); | |
return ws; | |
} | |
std::string StringConverter::WideStringToString(const std::wstring& ws) { | |
int len = WideCharToMultiByte(CP_UTF8, 0, ws.c_str(), ws.length(), 0, 0, NULL, NULL); |
This file contains hidden or 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
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated | |
{ | |
if (!self.manuallyChangingMap) { | |
BOOL updateRegion = NO; | |
MKCoordinateRegion restrictedRegion = [self restrictedRegion]; | |
if ((mapView.region.span.latitudeDelta > restrictedRegion.span.latitudeDelta * 4) || (mapView.region.span.longitudeDelta > restrictedRegion.span.longitudeDelta * 4) ) { | |
updateRegion = YES; | |
} | |
if (fabs(mapView.region.center.latitude - restrictedRegion.center.latitude) > restrictedRegion.span.latitudeDelta) { |
This file contains hidden or 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 <UIKit/UIKit.h> | |
@interface UIImage (ResizeImage) | |
+ (UIImage *)convertImage:(UIImage *)image toSize:(CGSize)size; | |
@end |
This file contains hidden or 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
MKMapRect zoomRect = MKMapRectNull; | |
for (id <MKAnnotation> annotation in mapView.annotations) { | |
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); | |
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0); | |
if (MKMapRectIsNull(zoomRect)) { | |
zoomRect = pointRect; | |
} else { | |
zoomRect = MKMapRectUnion(zoomRect, pointRect); | |
} | |
} |
This file contains hidden or 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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
This file contains hidden or 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
/* | |
You can now create a spinner using any of the variants below: | |
$("#el").spin(); // Produces default Spinner using the text color of #el. | |
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
$("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
$("#el").spin(false); // Kills the spinner. |
This file contains hidden or 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
/* to use WebSQL or the SQLite plugin (https://github.com/davibe/Phonegap-SQLitePlugin) with the same function) */ | |
executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) { | |
var self = this; | |
if (typeof self.db.dbPath !== 'undefined') { | |
//Native SQLite DB with phonegap : https://github.com/davibe/Phonegap-SQLitePlugin/ | |
//this is a native DB, the method signature is different: | |
var sqlAndParams = [sql].concat(params); | |
var cb = function(res) { |
NewerOlder