Skip to content

Instantly share code, notes, and snippets.

View ingyesid's full-sized avatar
🏠
Working from home

Yesid Lázaro Mayoriano ingyesid

🏠
Working from home
View GitHub Profile
@ingyesid
ingyesid / timeline.php
Created December 26, 2012 17:03
this script is for get twitter user timeline with api 1.1 and oAuth
<?
function buildBaseString($baseURI, $method, $params) {
$r = array();
ksort($params);
foreach($params as $key=>$value){
$r[] = "$key=" . rawurlencode($value);
}
return $method."&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
}
@ingyesid
ingyesid / Twitter Time Line
Created March 14, 2013 01:33
Get twitter time line by username with out oAuth
https://api.twitter.com/1/statuses/user_timeline/<username>.json?callback=&count=<num_tweets>
@ingyesid
ingyesid / Static Map
Created March 14, 2013 01:41
Static Map Api
http://maps.google.com/maps/api/staticmap?center=<lat>,<long>&size=<with>x<height>&maptype=roadmap&sensor=true&zoom=<zoom>&markers=color:blue|<lat>,<long>
package com.yelp.android.ui.widgets;
import com.yelp.android.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
package some.awesome.package;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.Transformation;
import android.widget.RelativeLayout;
@ingyesid
ingyesid / fingerprints
Created May 7, 2013 05:13
get android key store certificate fingerprints
keytool -list -v -keystore <keystore_name> -alias <aliasname>
@ingyesid
ingyesid / gist:5624933
Last active December 17, 2015 14:29
method for make http request
public static JSONObject makeHttpRequest(String url, String method,
List<NameValuePair> params) throws IOException {
AndroidHttpClient httpClient = null;
JSONObject json = null;
try {
// Building the request
httpClient = AndroidHttpClient.newInstance("android");
HttpConnectionParams.setConnectionTimeout(httpClient.getParams(),
ContentValues my_values = new ContentValues();
values.put("address", "+9233397365xx");//sender name
values.put("body", "this is my text");
getContentResolver().insert(Uri.parse("content://sms/inbox"), my_values);
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.WRITE_SMS"/>
/**
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable).
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while
* the alpha values are derived from the source's grayscaled RGB values. The effect is that
* you can see through darker parts of the source bitmap, while lighter parts show up as
* the given color. The 'invert' argument inverts the computation of alpha values, and looks
* best when the given color is a dark.
*/
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) {
int width = src.getIntrinsicWidth();