技术小黑屋

自定义Octopress404页面

刚刚在Octopress实现了自定义的404页面。参考别人的文章写的,很容易实现,谁知发现写完后,感觉自己掉进了一个坑,然后又爬了出来,所以,有必要自己写出来一个超级精简没有坑的帖子帮助别人。

Gmail垃圾邮件过滤器文件分享

Gmail垃圾邮件过滤器文件。
A filter file for Gmail to auto-delete spams.
工作后,一直使用Gmail邮件托管工作邮箱,收到的反馈很多,其中垃圾邮件,SEO,推销等邮件亦很多。还好Gmail提供了强大了过滤功能。以下是自己整理的一些垃圾邮件过滤文件,现在分享以下,以后会不断更新。

快速高效调试移动端前端代码

通常,前端调试输出一些日志信息可以使用alert或者console, 当然在Desktop机器上很容易,很多浏览器都支持,如果是在手机上,可能比较麻烦,怎么得到输出的console信息呢.

程序实现自己管理数据清理工作

How to disable system clear button and replace it with self application Manage Space?

Android在处理清楚数据时,会在系统的设置选项应用中,有一个清除数据的按钮,点下这个按钮之后,该应用的几乎所有数据都会被清除。具体清除了哪些数据,请参考这篇文章。http://droidyue.com/blog/2014/06/15/what-will-be-removed-if-you-click-clear-data-button-in-system-application-item/

Android中系统设置中的清除数据究竟会清除哪些数据

What will be removed If you click Clear Data Button in the System Application

今天中的一个story突然提到了系统设置中的清理数据,后来开始思考究竟系统的应用的这个清理功能,究竟会清理那些数据。 于是开始研究,以com.mx.browser为例,思路大概为首先为/data/data/com.mx.browser下的每一个文件夹下建立一个标志文件,这里为1.txt,然后执行清理数据操作,最后对比结果。 首先,进行清楚数据之前的的各个文件夹的情况。

检查Android是否具有摄像头

通常我们进行摄像头操作,如扫描二维码需要判断是否有后置摄像头(Rear camera),比如Nexus 7 一代就没有后置摄像头,这样在尝试使用的时候,我们需要进行判断进行一些提示或者处理。

去除mysql连接时的报警音

在使用命令行进入mysql时如果没有进行设置会有报警音很是吓人,使用这个命令可以去掉吓人的声音。

1
mysql -h localhost -u root -b -p

起作用的就是-p。

Others

Quickly Find Content in Files

Although Eclipse does provide a lot of facilities for Finding content is Workspace files, it maybe less efficient for find something such as a certain package or class usage. Actually we could do it more efficient and geeky.

Android NinePatch Attention

I have got many crash report data about using NinePath Drwable. I put a .9.png file into the drawable-xhdpi folder and the file did not exist in any other folder. And I got ResourceNotFoundException. I got this following sayings.

Use Vim in StackEdit

StackEdit is really great online editor. It could connect with Google Drive. And what’s more, you can even use Vim in this editor.
Now add the following snippet into SettingsExtensionsUserCustom extension javascript area.

linenos:false
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
userCustom.onReady = function() {
        var ace = {}
        ace.require = require
        ace.define = define
    ace.require(["ace/lib/net"], function(acenet) {
        acenet.loadScript("https://rawgit.com/androidyue/resources/master/keybinding-vim.js", function() {
                        e = document.querySelector(".ace_editor").env.editor
            ace.require(["ace/keyboard/vim"], function(acevim) {
                                e.setKeyboardHandler(acevim.handler);

            });

        });

    });
        window.ace = ace;

};

Others

Fix Notification Switching Position Issue

I once faced with a problem. I wrote a piece of code related with notifcation. Everything goes fine except one little issue. I found the ongoing notification switching order. My notification blinked each second. After Googling I found the reason and resolved the problem.

Fix No Sound Issue on Mac

Now I am dealing with Mac OSX. However I found sometimes this is no sound. People say it’s a bug. I have tried some methods. And found this goes for me every time.

1
2
3
#!/bin/bash
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext

Put the code into a shell script and run the script whenever the issue occurs.

Others

Scan Media Files in Android

I once tried to use MediaScanner to resolve problems; however it turned out to be a failure. Now I make it.This post is to write down why I failed and how I work it out now. I think it could be deeper that other posts.

Set the Preferred Application in Android

A great application should provide a function to let users set it as the preferred or default application. In this post, I will make a description on PreferredApplication
Before an application is about to be set as default, it has two possibilities. One is that there is already a default application and the other is no default application.

日语文法:ください

Nをください

  • 意思:请…
  • 例句:
  • りんごをください  请把苹果给我
  • ほんを私にください 请把书给我一下。

Fix Missing Command Takes Too Long to Respond in Fedora

I am getting well on with Fedora now. However when I was a fresher to Fedora, I have met a lot of problems.
One of them is that When I type some wrong commands It will take too long to respond. It’s totally different from Ubuntu,which I used before. However I like it could quickly reponse even through the command does not exist.

1
unset command_not_found_handle

Ok.Add the above code to .bashrc And it works.

Others