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
Use a code editor with Regex find and replace. Then search: | |
console.log\(.*\)\;? | |
And replace with an empty 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
/* | |
With PhoneGap's device plugin, using device.name yields | |
something like "iPhone6,1" which is an identifier, not a | |
name. This function converts it to a meaningfull model name. | |
Example: | |
var model = getiOSModelName(device.name); | |
model = "iPhone 5s" | |
*/ |
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
tell application "Terminal" | |
do script ("cordova prepare ios") in window 1 | |
end tell | |
delay 3 | |
tell application "Xcode" | |
activate | |
end tell | |
tell application "System Events" |
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
// changes frame for a rect with a default anchorPoint of (.5, .5) to remain | |
// in the same place with a different anchorPoint, because you can't change | |
// an anchorPoint in interface builder | |
-(CGRect) translateFrame:(CGRect)frame forAnchorPoint:(CGPoint)anchorPoint { | |
NSLog(@"translate frame starting frame: %@ for anchorPoint: %@", NSStringFromCGRect(frame), NSStringFromCGPoint(anchorPoint)); | |
CGRect newFrame = frame; | |
float xAdjustment = anchorPoint.x - .5; | |
float yAdjustment = anchorPoint.y - .5; | |
newFrame.origin.x = frame.origin.x + frame.size.width * xAdjustment; |
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
(function (angular) { | |
'use strict'; | |
// Scroll Spy Directive | |
// =============================== | |
// | |
// * **Author:** Jamie Perkins | |
// | |
// $broadcast an event when an element comes into or goes out of view: |
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
// Make sure you scroll down to get all data loaded | |
var text = 'First, Last, Email\n'; | |
angular.forEach($scope.filteredTesters, function(val) { | |
text += val.firstName.value + ','; | |
text += val.lastName.value + ','; | |
text += val.emailAddress.value + '\n'; | |
}); | |
var a = document.createElement("a"); | |
var file = new Blob([text], {type: 'text/csv'}); | |
a.href = URL.createObjectURL(file); |
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 *)keychainStatusToString:(OSStatus)status { | |
switch (status) { | |
case 0: | |
return @"Success"; | |
case -4: | |
return @"Function or operation not implemented."; | |
case -50: | |
return @"One or more parameters passed to the function were not valid."; | |
case -108: |
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
if (window.chrome && window.chrome.loadTimes) { | |
let load = chrome.loadTimes(); | |
const getFP = function() { | |
let fp = (load.firstPaintTime - load.startLoadTime) * 1000; | |
return Math.round(fp); | |
}; | |
let fp = getFP(); | |
console.log(`first paint: ${fp} ms`); |
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 Foundation | |
import CoreLocation | |
struct randomLocations { | |
// create random locations (lat and long coordinates) around user's location | |
func getMockLocationsFor(location: CLLocation, itemCount: Int) -> [CLLocation] { | |
func getBase(number: Double) -> Double { | |
return round(number * 1000)/1000 |
OlderNewer