Skip to content

Instantly share code, notes, and snippets.

View damonliuchn's full-sized avatar
🎯
Focusing

Damon Liu damonliuchn

🎯
Focusing
View GitHub Profile
@ZoolWay
ZoolWay / tamper-xpath.js
Created August 28, 2020 07:07
Tampermonkey, XPath parser function for javascript console
// ==UserScript==
// @name ricky_xpath
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://*/*
// @match http://*/*
// @grant none
// ==/UserScript==
@bryanstern
bryanstern / OkHttpStack.java
Last active April 24, 2022 03:17
An OkHttp backed HttpStack for Volley
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@mohibsheth
mohibsheth / Devices.cs
Created January 21, 2015 13:03
Xamarin Android: Helper class to get the consumer friendly device name.
/*
* Copyright (C) 2015 Mohib Sheth <mohib.sheth@gmail.com>
*
* Original Java version Copyright (C) 2014 Jared Rummler <jared.rummler@gmail.com>
* https://gist.github.com/jaredrummler/16ed4f1c14189375131d
*
* 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
*
@darnmason
darnmason / HeaderViewRecyclerAdapter.java
Last active March 21, 2020 17:19
RecyclerView adapter designed to wrap an existing adapter allowing the addition of header views and footer views.
/*
* Copyright (C) 2014 darnmason
*
* 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
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@ma34s
ma34s / PackageManagerService.java
Created May 7, 2014 04:21
LGL22のcom\android\server\pm\PackageManagerService.javaのjavaソース化
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) ansi
package com.android.server.pm;
import android.app.*;
import android.app.admin.IDevicePolicyManager;
import android.app.backup.IBackupManager;
import android.content.*;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: