Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
private String readGroup(String group){ | |
String[] readDigit = {" Không", " Một", " Hai", " Ba", " Bốn", " Năm", " Sáu", " Bảy", " Tám", " Chín" }; | |
String temp = ""; | |
if (group == "000") return ""; | |
//read number hundreds | |
temp = readDigit[Integer.parseInt(group.substring(0,1))] + " Trăm"; | |
//read number tens | |
if (group.substring(1,2).equals("0")) | |
if (group.substring(2,3).equals("0")) return temp; | |
else |
public Bitmap scaleBitmapDown(Bitmap bitmap, int maxDimension) { | |
int originalWidth = bitmap.getWidth(); | |
int originalHeight = bitmap.getHeight(); | |
int resizedWidth = maxDimension; | |
int resizedHeight = maxDimension; | |
if (originalHeight > originalWidth) { | |
resizedHeight = maxDimension; | |
resizedWidth = (int) (resizedHeight * (float) originalWidth / (float) originalHeight); |
if let userToken = result.token { | |
// Get user access token | |
let token: FBSDKAccessToken = result.token | |
let protectedPage = self.storyboard?.instantiateViewControllerWithIdentifier("ProtectedPageViewController") as! ProtectedPageViewController | |
let protectedPageNav = UINavigationController(rootViewController: protectedPage) | |
let appDelegate = UIApplication.shareApplication().delegate as! AppDelegate | |
appDelegate.window?.rootViewController = protectedPageNav |
private void addContact(ContactDetail c) { | |
ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); | |
int rawContactInsertIndex = ops.size(); | |
ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI) | |
.withValue(RawContacts.ACCOUNT_TYPE, null) | |
.withValue(RawContacts.ACCOUNT_NAME, null).build()); | |
//Phone Number | |
if(null!=c.getPhoneNumber()){ |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
from models import BaseModel | |
class BaseAdmin(admin.ModelAdmin): | |
def save_model(self, request, obj, form, change): | |
if not change: | |
obj.created_by = request.user | |
obj.last_updated_by = request.user | |
obj.save() |
$.event.special.widthChanged = { | |
remove : function() { | |
$(this).children('iframe.width-changed').remove(); | |
}, | |
add : function() { | |
var ss = document.createElement('style'); | |
ss.type = "text/css"; | |
ss.innerHTML = "iframe.width-changed {width: 100%;display: block;border: 0;height: 0;margin: 0;}"; | |
document.body.appendChild(ss); | |
var elm = $(this); |
<link rel="stylesheet" type="text/css" | |
href="#{request.contextPath}/resources/css/bootstrap.min.css"> |