Skip to content

Instantly share code, notes, and snippets.

@khris
khris / gist:4664150
Last active December 11, 2015 21:39
Cookie synchronization between WebView and HttpClient
CookieManager cookieManager = CookieManager.getInstance();
BasicCookieStore cookieStore = new BasicCookieStore();
final String appDomain = mContext.getResources().getString(R.string.app_domain);
String cookies = cookieManager.getCookie(appDomain);
String[] splitCookies = cookies.split(";");
for (String cookie : splitCookies) {
String[] cookieParts = cookie.split("=");
if (cookieParts.length > 0) {
String cookieValue = "";
if (cookieParts.length >= 2) {
/**
*
* It's under MPL 1.1
* See http://www.mozilla.org/MPL/1.1/
* You can install this from https://addons.mozilla.org/ko/firefox/addon/naver-endic/
*
*/
let { Ci, Cc } = require("chrome");
let Panel = require("panel").Panel;
@khris
khris / gist:2910153
Created June 11, 2012 13:45
fucking php gettext with js for gedit3
d=window.get_active_document();s,e=d.get_selection_bounds();t=d.get_text(s,e,True);d.delete_selection(False,False);d.insert_at_cursor(''.join(("<?=_('",t,"')?>")))