Skip to content

Instantly share code, notes, and snippets.

@withparadox2
withparadox2 / quine.js
Created February 16, 2019 11:46
quine
function quine() {
var arr = [
"function quine() {",
" var arr = [",
" ]",
" for (var i = 0; i < 3; i++) {",
" console.log(arr[i])",
" }",
" for (var i = 0; i < arr.length; i++) {",
" console.log(' ' + String.fromCharCode(34) + arr[i] + String.fromCharCode(34) + ',')",
````````
========================
1. 安装msys2-i686-20160205.exe,目标目录F:\msys32。
2. 修改F:\msys32\etc\pacman.d,配置msys2和mingw-w64镜像(一般用户请忽略本步骤)。
3. 升级基本环境。
运行msys2_shell.bat
更新本地包数据
pacman -Sy
@withparadox2
withparadox2 / build.gradle
Created January 3, 2017 09:09
编译时插入字节码
import javassist.ClassPool
import javassist.CtClass
apply plugin: 'com.android.application'
apply plugin: 'com.antfortune.freeline'
def sdkVersion() {
return 23
}
@withparadox2
withparadox2 / build.gradle
Last active June 24, 2016 00:08
在打包过程中删除某个jar包
// 这段代码直接放在相应module的build.gradle最下面就可以了
//
// 新版gradle没有dexXXX的task了,我只能在transformClassesWithDexForDebug
// 这个task执行之前删除相应的jar包,注意这里使用了doFirst而没有使用task依赖,
// 所以必须保证每次打包前clean下,不然如果task的状态是UP-TO-DATE,就不会执行
// doFirst里面的代码
def deleteClass = {
android.applicationVariants.all { variant ->
def varName = variant.name
def varNameCap = varName.capitalize()
@withparadox2
withparadox2 / build.gradle
Last active March 30, 2016 04:03
删除unused resources
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.withparadox2.bytecode"
minSdkVersion 14
targetSdkVersion 23
class RecycleBin {
private RecyclerListener mRecyclerListener;
/**
* The position of the first view stored in mActiveViews.
*/
private int mFirstActivePosition;
/**
* Views that were on screen at the start of layout. This array is populated at the start of
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest