Skip to content

Instantly share code, notes, and snippets.

View bopbi's full-sized avatar
💭
🕺 🕺

Bobby Prabowo bopbi

💭
🕺 🕺
View GitHub Profile
@bopbi
bopbi / gist:9305943
Created March 2, 2014 12:37
Generate Android Publish Key
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
@bopbi
bopbi / get_android_db.sh
Created March 9, 2014 23:53
Get android db shell script
package=$1
db_name=$2
adb shell "run-as $package cat databases/$db_name > /sdcard/$db_name"
adb pull /sdcard/$db_name
open $db_name
@bopbi
bopbi / gist:10013251
Created April 7, 2014 00:47
Get visible listview item
final int nFirst = listView.getFirstVisiblePosition();
final int nLast = listView.getLastVisiblePosition();
for (int position = nFirst; position <= nLast; ++position) {
View itemView = listView.getChildAt(position - nFirst);
// modified here
}
@bopbi
bopbi / login.go
Last active August 29, 2015 13:58
Login for Appengine in go using oauth on twitter. taken from https://github.com/kurrik/twittergo-examples/blob/master/sign_in/main.go
package fotokecil
import (
"crypto/rand"
"encoding/base64"
"fmt"
"github.com/kurrik/oauth1a"
"io"
"log"
"net/http"
@bopbi
bopbi / test.go
Last active August 29, 2015 14:00
GoLang JSON Encoding Example in go
package kulinr
import (
"net/http"
"encoding/json"
"strconv"
)
type Spot struct {
Spot_id string `json:"spot_id"`
@bopbi
bopbi / gist:1ebc2702ce726de2099a
Created December 8, 2014 16:24
set status bar color in lollipop
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(getResources().getColor(R.color.some_color));
}
@bopbi
bopbi / Info.plist
Created February 9, 2015 15:07
Info.Plist for Mac Tizen IDE to use the retina resolution
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
@bopbi
bopbi / gist:9f85f227234102085675
Created March 14, 2015 06:59
Blank Retrofit Converter
package com.arjunalabs.readcommit.utils;
import java.lang.reflect.Type;
import retrofit.converter.ConversionException;
import retrofit.converter.Converter;
import retrofit.mime.TypedInput;
import retrofit.mime.TypedOutput;
/**
@bopbi
bopbi / copydb.sh
Created June 30, 2015 16:27
Copy android sqlite db to sd card
#!/bin/bash
echo copying sqlite db file named $2 from package $1 to folder /sdcard/tempDB
adb shell "run-as $1 chmod 777 /data/data/$1/databases/$2"
adb shell "mkdir -p /sdcard/tempDB"
adb shell "cp -r /data/data/$1/databases/$2 /sdcard/tempDB/."
#include <stdio.h>
#include <stdlib.h>
struct linked_list {
int value;
struct linked_list *next;
};
struct node {
int value;