Skip to content

Instantly share code, notes, and snippets.

View nguyenvanduocit's full-sized avatar
🌴
On vacation

Duoc Nguyen nguyenvanduocit

🌴
On vacation
View GitHub Profile
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
classes/
@nguyenvanduocit
nguyenvanduocit / Launch the 'Add Contact'
Created June 1, 2014 19:07
Launch the 'Add Contact'
// Add listener so your activity gets called back upon completion of action,
// in this case with ability to get handle to newly added contact
myActivity.addActivityListener(someActivityListener);
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
// Just two examples of information you can send to pre-fill out data for the
// user. See android.provider.ContactsContract.Intents.Insert for the complete
// list.
<?php
// make api call
$response = (new FacebookRequest(
$session, 'POST', '/me/feed', array(
'name' => 'Facebook API: Posting a Status Update Using PHP SDK 4.0.x',
'caption' => "I'm rewriting old tutorials to work with the new PHP SDK 4.0 and Graph API 2.0.",
'link' => 'https://muatocroi.com',
'message' => 'Check out my new tutorial'
)
<?php
class Curl {
/**
* cURL request method
*
* @var string
*/
protected $_method = 'GET';
@nguyenvanduocit
nguyenvanduocit / ShareUtils.java
Created July 23, 2014 03:23
Android Share action
/*
* Copyright 2014 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nguyenvanduocit
nguyenvanduocit / ShortcutUtils.java
Created July 23, 2014 03:24
#android user to create shortcut on desktop
/*
* Copyright 2014 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nguyenvanduocit
nguyenvanduocit / product_filter_menu.xml
Created July 23, 2014 06:53
#android #layout #menu Android Radio actionbar menu
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_action_activity_filter"
android:icon="@drawable/ic_action_filter"
android:orderInCategory="2"
bootstrap:showAsAction="always"
android:title="@string/action_product_filter">
<group
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@nguyenvanduocit
nguyenvanduocit / selector.link.external.css
Created August 18, 2014 16:48
external link selector
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,