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
In order for this to work, you need to import Evenkit at the top of your file. | |
Then you can add the function setiCalEvent to your file and then you can simply use <code> [self setiCalEvent:true]; </code> or <code> [self setiCalEvent:false]; </code>. You don't need yo save any data inside your app to remove them later on, because the app does a search query. | |
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
Animating a section to full screen in with jquery: | |
A few notes: | |
- This was made in 5 minutes; it can be a little sloppy. | |
- You need to import JQuery in your page. | |
- It'll probably work with non bootstrap sites too, I haven't had time to test it. | |
- You need to bind the goFullScreen() function to some kind of action. | |
- This Gist is far from finished. Things I hope to add in the future include: | |
- Leave full screen | |
- Instead of moving the navbar, or some other element up. Diynamically select everything prior to the current sectino |
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
$("form :input").each(function(index, elem) { | |
var eId = $(elem).attr("id"); | |
var label = null; | |
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { | |
$(elem).attr("placeholder", $(label).html()); | |
$(label).remove(); | |
} | |
}); |
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
git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch MY-BIG-DIRECTORY-OR-FILE' --tag-name-filter cat -- --all |
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
for family in UIFont.familyNames() { | |
println(family); | |
var family: String = family as String | |
for name in UIFont.fontNamesForFamilyName(family) { | |
println(" \(name)"); | |
} | |
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
func addUserToAddressBook(contact: User){ | |
let stat = ABAddressBookGetAuthorizationStatus() | |
switch stat { | |
case .Denied, .Restricted: | |
println("no access to addressbook") | |
case .Authorized, .NotDetermined: | |
var err : Unmanaged<CFError>? = nil | |
var adbk : ABAddressBook? = ABAddressBookCreateWithOptions(nil, &err).takeRetainedValue() | |
if adbk == nil { | |
println(err) |
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
var convertToSeconds = function(time) { | |
if(!isNaN(time)){ | |
return time | |
} | |
var timeArray = time.split(':'), | |
seconds = 0, minutes = 1; | |
while (timeArray.length > 0) { |
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
// order an array | |
// to use: <div ng-repeat="thing in things | orderTimeObjectBy:'order'"> | |
app.filter('orderObjectBy', function() { | |
return function(items, field, reverse) { | |
var filtered = []; | |
angular.forEach(items, function(item) { | |
filtered.push(item); | |
}); | |
filtered.sort(function (a, b) { | |
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
class TextView: UITextView { | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
addContentSizeObserver() | |
} | |
override init(frame: CGRect, textContainer: NSTextContainer?) { | |
super.init(frame: frame, textContainer: textContainer) | |
} |
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
class VerticalCenteredTextView: UITextView { | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
addContentSizeObserver() | |
} | |
override init(frame: CGRect, textContainer: NSTextContainer?) { | |
super.init(frame: frame, textContainer: textContainer) | |
} |
OlderNewer