Skip to content

Instantly share code, notes, and snippets.

View s1ntoneli's full-sized avatar
🤣
wow! wondering!

Sintone s1ntoneli

🤣
wow! wondering!
View GitHub Profile
@s1ntoneli
s1ntoneli / ghost.md
Created November 19, 2017 16:49
在 Centos 6 部署 ghost 的坑
  1. 不能安装 sqlite3,使用 mysql 代替
  2. mysql 新建用户不能用密码登录。 因为新建 mysql 时新建了匿名用户,本地登录时默认使用了匿名用户账号。而这些匿名用户是没有密码的。
  3. mysql 权限问题 使用超级用户运行

GithubBrowserSample

GithubApp

这个类做了一些依赖注入的初始化,在 Debug 版本使用 Timber 打印更详细的 log。

  1. @Inject
  2. Timber
  3. BuildConfig
@s1ntoneli
s1ntoneli / ApiResponse.java
Last active November 24, 2017 07:44
单一数据源模型
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@s1ntoneli
s1ntoneli / webview.md
Last active November 29, 2017 04:42
webview 打开 36kr 文章显示空白

Photoshop 最简单的魔法

@s1ntoneli
s1ntoneli / ViewToBitmap.java
Last active February 28, 2020 04:13
Android 把 View 转成 Bitmap,两种方式
public static Bitmap getBitmapFromView(View view) {
view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
// IMPORTANT
// 如果 View 没有在屏幕上显示过,那么一定要执行这行,否则画出来是空白的
view.layout(0,0, view.getMeasuredWidth(), view.getMeasuredHeight());
//Define a bitmap with the same size as the view
Bitmap returnedBitmap = Bitmap.createBitmap(view.getMeasuredWidth(), view.getMeasuredHeight(),Bitmap.Config.ARGB_8888);
//Bind a canvas to it
Canvas canvas = new Canvas(returnedBitmap);
//Get the view's background
@s1ntoneli
s1ntoneli / TabLayout_Draft_1.java
Last active December 29, 2017 09:09
重写 TabLayout 实现微博客户端顶部蚯蚓导航
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@s1ntoneli
s1ntoneli / SwipeBackActivity.java
Last active January 30, 2018 06:25
右滑返回
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
/**
* Created by lixindong on 1/4/18.
*/
@s1ntoneli
s1ntoneli / README.md
Created February 10, 2018 01:25
视频下载器

相对在线转换下载优势:

  1. 无广告
  2. 一键下载无需跳转
  3. 断点续传
  4. 播放列表批量下载
  5. 支持站点多

相对 4K Downloader 优势

  1. 支持简单脚本批量生成网址
  2. 播放列表下载无 25 个视频限制
@s1ntoneli
s1ntoneli / README.md
Created February 22, 2018 03:59
一些算法、一些问题解决思路

目录