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
/** | |
* Converts a timestamp to how long ago syntax | |
* @param time The time in seconds | |
* @return The formatted time | |
*/ | |
public static String timeAgo(int time) | |
{ | |
Unit[] units = new Unit[] | |
{ | |
new Unit("s", 60, 1), |
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
#include <stdio.h> | |
static unsigned char cell[30000]; | |
static unsigned char *ptr; | |
void processCommand(char command, FILE *file) | |
{ | |
char cmd; | |
long pos; | |
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
//******************************************************************** | |
// | |
// jQuery delay created by Callum Taylor | |
// v 0.1 | |
// This simple function is to emulate a javascript setTimeout but | |
// in a jQuery way. This is not the same as the standard effects delay | |
// where you can only use delay AFTER an effect, this plugin can | |
// be used on its own to delay a function from executing | |
// | |
// Usage: |
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
//******************************************************************** | |
// | |
// jQuery imageSlide created by Callum Taylor | |
// v 0.3 | |
// | |
// Usage: | |
// $('div').imageSlide({timeout: 2000, children:"div", fadesSpeed:1000, loop: 2}, callback); | |
// | |
//******************************************************************** | |
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
ob_end_clean(); | |
ob_start(); | |
//output the message | |
echo ($message); | |
flush(); | |
ob_end_clean(); | |
exit(); |
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
String telNum = "tel:" + url.getHost().replaceAll(" ", ""); | |
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(telNum)); | |
startActivity(intent); |
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
MailTo mail = MailTo.parse(url.toString()); | |
Intent intent = new Intent(Intent.ACTION_SEND); | |
intent.setType("plain/text"); | |
if (!StringUtils.isEmpty(website) && !StringUtils.isEmpty(email)) | |
{ | |
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email + "@" + website}); | |
} | |
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
Intent market = new Intent(Intent.ACTION_VIEW); | |
market.setData(Uri.parse("market://details?id=" + getPackageName())); | |
startActivity(market); |
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
Intent webIntent = new Intent(Intent.ACTION_VIEW); | |
webIntent.setData(Uri.parse(URL)); | |
startActivity(webIntent); |
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
editText.requestFocus(); | |
editText.requestFocusFromTouch(); | |
InputMethodManager m = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE); | |
m.showSoftInput(editText, 0); |
OlderNewer