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
ifconfig | grep inet | awk 'END{print}' | awk '{print $2}' |
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(final Annotation annotation : this.getClass().getAnnotations()) { | |
final Class<? extends Annotation> annotationType = annotation.annotationType(); | |
final boolean classIsAnnotated = annotationType.equals(MyCustomAnnotation.class); | |
} |
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
ps aux | grep outlook | awk '{print $2}' | xargs kill -9 |
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 http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
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
public class ContactsProvider { | |
private Uri QUERY_URI = ContactsContract.Contacts.CONTENT_URI; | |
private String CONTACT_ID = ContactsContract.Contacts._ID; | |
private String DISPLAY_NAME = ContactsContract.Contacts.DISPLAY_NAME; | |
private Uri EMAIL_CONTENT_URI = ContactsContract.CommonDataKinds.Email.CONTENT_URI; | |
private String EMAIL_CONTACT_ID = ContactsContract.CommonDataKinds.Email.CONTACT_ID; | |
private String EMAIL_DATA = ContactsContract.CommonDataKinds.Email.DATA; | |
private String HAS_PHONE_NUMBER = ContactsContract.Contacts.HAS_PHONE_NUMBER; | |
private String PHONE_NUMBER = ContactsContract.CommonDataKinds.Phone.NUMBER; |
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
@Override protected void onPause() { | |
super.onPause(); | |
if (subscription != null && !subscription.isUnsubscribed()) { | |
subscription.unsubscribe(); | |
} | |
} |
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
@Override protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
info = (TextView) findViewById(R.id.info); | |
swipe = new Swipe(); | |
subscription = swipe.observe() | |
.subscribeOn(Schedulers.computation()) | |
.observeOn(AndroidSchedulers.mainThread()) |
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
@Override public boolean dispatchTouchEvent(MotionEvent event) { | |
swipe.dispatchTouchEvent(event); | |
return super.dispatchTouchEvent(event); | |
} |
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
@Override protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
info = (TextView) findViewById(R.id.info); | |
swipe = new Swipe(); | |
swipe.addListener(new SwipeListener() { | |
@Override public void onSwipingLeft(final MotionEvent event) { | |
info.setText("SWIPING_LEFT"); |