Skip to content

Instantly share code, notes, and snippets.

View undownding's full-sized avatar
🤣
C'est la vie

undownding undownding

🤣
C'est la vie
View GitHub Profile
865a866,874
> // 1dmy
> {
> prefix: "gitlab.1dmy.com:10022/",
> re: `^(?P<root>gitlab\.1dmy\.com:10022/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`,
> ping: false,
> vcs: "git",
> repo: "ssh://git@gitlab.1dmy.com:10022/{p}.git",
> },
>
@undownding
undownding / styles.xml
Created January 26, 2016 06:00
Modify NavigationBar color
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:navigationBarColor">@color/colorPrimaryDark</item>
</style>
@undownding
undownding / code.kt
Last active January 26, 2016 05:00
Recyclerview auto load more when scroll to bottom
inner class OnScrollListener(): RecyclerView.OnScrollListener() {
var isLoadingMore = false
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
val lastVisibleItem: Int = (recyclerView?.layoutManager as LinearLayoutManager).findLastVisibleItemPosition()
val totalItemCount: Int = (recyclerView?.layoutManager as LinearLayoutManager).itemCount
if (lastVisibleItem >= totalItemCount - 4 && dy > 0) { // 4 items left to the bottom.
if (!isLoadingMore) { // not lock, load more.
@undownding
undownding / dns-clean.sh
Created August 3, 2015 03:06
dns-clean.sh
#!/bin/ash
#这行是用一个不存在的域名解析来钓出强制跳转地址
NONEXISTDOMAIN="non.exist.domain.cn"
#这行写入一些会被污染的域名
POSIONEDDOMAIN="www.twitter.com www.facebook.com www.youtube.com plus.google.com"
#下面这行写入本地的DNS地址,即被污染的DNS服务地址
@undownding
undownding / get_ip.sh
Created July 29, 2015 05:11
Get IP address from hostname
nslookup shadowsocks.org | awk -F': ' 'NR==6 { print $2 } '