Skip to content

Instantly share code, notes, and snippets.

@ljanzik
ljanzik / fruitstrap.sh
Created February 13, 2013 13:55
Deploy a iOS App and start Debug Session via Commandline with fruitstrap
/Path/To/fruitstrap -d -b /Path/To/Your_App.app
@ljanzik
ljanzik / video.html
Last active December 11, 2015 20:19
Disabling AirPlay for Video on Website
<video src="video.mov"
height="768" width="1024"
x-webkit-airplay="deny" >
</video>
<!-- or -->
<embed airplay="deny"
src="movie.mov"
width=320
@ljanzik
ljanzik / gist:4653793
Created January 28, 2013 08:04
iOS :: External Screen Notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(screenDidConnect:)
name:UIScreenDidConnectNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(screenDidConnect:)
name:UIScreenDidDisconnectNotification
object:nil];
@ljanzik
ljanzik / with-modified-roboject.java
Created September 25, 2012 09:34
Demonstration of Roboject
@InjectLayout(R.layout.example)
public class ExampleActivity extends RobojectActivity {
@InjectView(R.id.text_view)
private TextView textView;
@InjectView(R.id.edit_text)
private EditText editText;
}
@ljanzik
ljanzik / Activity.java
Created September 10, 2012 11:21
Using Pull-To-Refresh
// Set a listener to be invoked when the list should be refreshed.
PullToRefreshListView pullToRefreshView = (PullToRefreshListView) findViewById(R.id.pull_to_refresh_listview);
pullToRefreshView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
// Do work to refresh the list here.
new GetDataTask().execute();
}
});
@ljanzik
ljanzik / .project
Created June 17, 2012 17:34
Building Android App with Maven
<projectDescription>
<name>thoughtsonmobile-testapp</name>
<projects/>
<buildSpec>
<!-- added two adt build commands for full eclipse support -->
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments></arguments>
</buildCommand>
<buildCommand>
@ljanzik
ljanzik / flashScrollbars.m
Created June 5, 2012 21:01
Useful Snippets for working with UIWebView
for (id subView in [webView subviews]) {
if ([subView respondsToSelector:@selector(flashScrollIndicators)]) {
[subView flashScrollIndicators];
}
}
@ljanzik
ljanzik / javascript.js
Created June 1, 2012 11:27
E-Mails versenden mit Phonegap: iOS
EmailComposer.prototype.showEmailComposer = function(subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML,attachment) {
var args = {};
if(toRecipients)
args.toRecipients = toRecipients;
if(ccRecipients)
args.ccRecipients = ccRecipients;
if(bccRecipients)
args.bccRecipients = bccRecipients;
if(subject)
args.subject = subject;
@ljanzik
ljanzik / MySegueWithCustomAnimation.h
Created May 30, 2012 09:54
Implement Custom Segue To Use Own Animation
#import <UIKit/UIKit.h>
@interface MySegueWithCustomAnimation : UIStoryboardSegue
@end