Skip to content

Instantly share code, notes, and snippets.

@ajamaica
ajamaica / gist:9223276
Created February 26, 2014 03:59
keybase.md
### Keybase proof
I hereby claim:
* I am ajamaica on github.
* I am ajamaica (https://keybase.io/ajamaica) on keybase.
* I have a public key whose fingerprint is 837F 8E4A E1F3 EE73 C607 5CDE 2457 0258 D560 8A08
To claim this, I am signing this object:
static NSString *identifier = @"RoutePinAnnotation";
MKPinAnnotationView* pinView = [[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:identifier] ;
pinView.animatesDrop=YES;
pinView.canShowCallout=YES;
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton setTitle:annotation.title forState:UIControlStateNormal];
[rightButton addTarget:self
@ajamaica
ajamaica / activity.java
Created February 5, 2015 19:29
giro android
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
setContentView(R.layout.activity_splash);
}
else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
setContentView(R.layout.activity_splash);
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
asyncHttpClient.prepareGet("http://hsasolutions.cloudapp.net/OptiCompraWS/OptiC/B/Opticompra.asmx/EntregaPrecios?pIdMuni=0&id_prod=339&pos_lat=0&pos_lon=0&Login_app=0&Password_app=0&pVers=0&pRadio=0").execute(new AsyncCompletionHandler(){
@Override
public Response onCompleted(Response response) throws Exception{
// Do something with the Response
// ... `
return response;
}
4 + 3
4.0 - 3
5 / 3
4 and 5
#palabras = ["nintendo","xbox","wii u","playstation 4"]
#for palabra in palabras :
# print palabra, len(palabra)
#for i in range(-100,1001):
# print "No - %i" % i
palabras = ["nintendo","xbox","wii u","playstation 4"]
for palabra in palabras :
print palabra
@ajamaica
ajamaica / gist:8d6ba913c94c604b6900
Created April 6, 2015 19:51
setListViewHeightBasedOnChildren
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null) {
// pre-condition
return;
}
int totalHeight = listView.getPaddingTop() + listView.getPaddingBottom();
for (int i = 0; i < listAdapter.getCount(); i++) {
View listItem = listAdapter.getView(i, null, listView);
@ajamaica
ajamaica / gist:999059
Created May 30, 2011 15:30
Position Fixed Button
/* Requiere JQuery*/
if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
{
$("#footer").css("position", "static");
};
06/Jun/2011 10:13:09 INFO - EDU Media: user 'a' at 192.168.1.4:49298 connected.
06/Jun/2011 10:13:09 ERROR - Closed an unclosed RepLogin: <RepLogin: Test User (192.168.1.4:51282) - 2011-06-04 14:09:16.719014>
06/Jun/2011 10:13:09 INFO - Set logout_datetime for RepLogin Test User (192.168.1.4:51282) - 2011-06-04 14:09:16.719014
06/Jun/2011 10:13:41 INFO - Updated campaign 2.
06/Jun/2011 10:13:41 INFO - Attempting to refill Campaign Hopper for campaign 2 with 500 prospects
06/Jun/2011 10:13:42 WARNING - No unexpired, unpopped prospects to fill Campaign Hopper with for campaign 2!
06/Jun/2011 10:13:42 INFO - Attempting to refill hopper for campaign 2
06/Jun/2011 10:13:42 INFO - Updated campaign 2.
06/Jun/2011 10:13:48 INFO - Hopper for campaign 2 filled with 500 prospect(s).
06/Jun/2011 10:13:48 INFO - Attempting to refill Campaign Hopper for campaign 2 with 500 prospects
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 0 = [ppcc_campaign_slug=emg-edu]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 1 = [ppcc_test_call=yeppers]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 2 = [ppcc_pitch_pk=2]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 3 = [cc_base_score=0]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 4 = [ppcc_dial_string=sofia/ppcc_queretaro/ajamaica-laptop%emg]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 5 = [ignore_early_media=true]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 6 = [ppcc_queue_name=emg-edu@emg]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 7 = [ppcc_call_leg_type=prospect]
2011-06-06 11:19:29.980690 [DEBUG] switch_ivr_originate.c:1973 variable string 8 = [ppcc_prospect_id=1960258]
2011-06-06 11: