Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View douzifly's full-sized avatar
🙄
I may be slow to respond.

xy douzifly

🙄
I may be slow to respond.
View GitHub Profile
https://www.baidu.com/aaa.mp4
https://www.xy.com/cccc.docx
https://www.xy.com/cddd.pdf
https://www.xy.com/cmmmm.torrent
https://www.xy.com/cmmmm.torrent
https://www.xy.com/cddd.pdf
www.aa.com/a.txta
https://www.baidu.com/bbb.txta
http://www.a.com/a.rara
http://www.a.com/a.rar
@douzifly
douzifly / dns.c
Created March 21, 2020 12:29 — forked from fffaraz/dns.c
DNS Query Code in C with linux sockets
//DNS Query Program on Linux
//Author : Silver Moon (m00n.silv3r@gmail.com)
//Dated : 29/4/2009
//Header Files
#include<stdio.h> //printf
#include<string.h> //strlen
#include<stdlib.h> //malloc
#include<sys/socket.h> //you know what this is for
#include<arpa/inet.h> //inet_addr , inet_ntoa , ntohs etc
@douzifly
douzifly / gist:7fa56b3857bc08c9a6ed
Created May 11, 2015 08:24
relayout ImageView with image size after image donwloaded
Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.test_dialog);
RecyclingImageView imageView = (RecyclingImageView) dialog.findViewById(R.id.dialog_header);
String url = "http://x.png";
DisplayImageOptions opts = RecyclingImageView.cloneDefaultOption();
opts.imageScaleType = ImageScaleType.NONE;
opts.displayer = new BitmapDisplayer() {
@Override
@douzifly
douzifly / gist:9fe028291385e408eedf
Last active August 29, 2015 14:10
safe android webview js
/**
* @author douzifly
* @date 2014-12-4
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.text.TextUtils;
import android.webkit.JsPromptResult;
@douzifly
douzifly / gist:4bfa54349dbbc5192672
Created December 1, 2014 14:41
fix android emulator sdcard readonly
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
@douzifly
douzifly / gist:87f122967b966e7e1952
Created July 22, 2014 09:27
android handle set as wallpaper
<intent-filter>
<action android:name="android.intent.action.ATTACH_DATA" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:scheme="file" />
<data android:mimeType="image/*" />
<category android:name="android.intent.category.ALTERNATIVE" />
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
</intent-filter>
@douzifly
douzifly / gist:148975a2feed13904b2f
Created June 30, 2014 06:13
dialog width match parent
void show() {
final Dialog dialog = new Dialog(this);
final Window window = dialog.getWindow();
window.requestFeature(Window.FEATURE_NO_TITLE);
window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
// set content view must before set other attributes
dialog.setContentView(R.layout.dialog_content);
final WindowManager.LayoutParams lp = window.getAttributes();
@douzifly
douzifly / gist:176d8072e0c0a2665379
Created June 13, 2014 03:45
Android FullScreen
public static void setFullScreen(Window window, boolean fullScreen) {
if (fullScreen) {
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
public static boolean isFullScreen(Window window) {
return (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
@douzifly
douzifly / gist:833d9b9568f29f0a2953
Created June 13, 2014 03:40
postOnLayoutFinished
public static void postOnLayoutFinished(final View v, final Runnable r) {
if (v == null || r == null) {
throw new NullPointerException();
}
v.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
r.run();
package com.qvod.player.utils;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import android.annotation.SuppressLint;
import android.content.Context;