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
/*
* Copyright (C) 2014 Chris Banes
*
* 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
/**
*
*/
package se.redsox;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.Roster;
@ingyesid
ingyesid / timeapp.php
Created August 18, 2013 21:36
Get user timeline , change your keys
<?
header('Content-type: application/json');
require_once('twitteroauth/twitteroauth.php');
$oauth_access_token = "YOUR_HERE";
$oauth_access_token_secret = "YOUR_HERE";
$consumer_key = "YOUR_HERE";
$consumer_secret = "YOUR_HERE";
if ($_GET["token"]!=$oauth_access_token) {
@ingyesid
ingyesid / Util.java
Created August 12, 2013 21:07
show hash for facebook sdk
public class Util{
public void printHashKey(Context context) {
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
"com.clickdelivery.android.redwings",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
@ingyesid
ingyesid / ConsumerWebService.java
Created August 5, 2013 14:48
Util class for make http request
package com.stefanini.android.cartermensajeria.ws;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
/**
* 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();
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"/>
@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(),
@ingyesid
ingyesid / fingerprints
Created May 7, 2013 05:13
get android key store certificate fingerprints
keytool -list -v -keystore <keystore_name> -alias <aliasname>
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;