Skip to content

Instantly share code, notes, and snippets.

View liufsd's full-sized avatar
🎯
Focusing

liupeng liufsd

🎯
Focusing
View GitHub Profile
@cxyxlxdm
cxyxlxdm / GridSpacingItemDecoration.md
Last active April 19, 2024 08:43
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
@yqritc
yqritc / gist:ccca77dc42f2364777e1
Last active March 29, 2024 10:25
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@peterli888
peterli888 / core.deltaBaseCacheLimit=2g 错误
Last active March 16, 2024 01:55
编译 v8 错误 core.deltaBaseCacheLimit=2g
编译 v8 core.deltaBaseCacheLimit=2g 错误
修改 depot_tools/gclient_utils.py
return '512m'
@rponte
rponte / get-latest-tag-on-git.sh
Last active March 11, 2024 07:50
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@RitvikMandyam
RitvikMandyam / BUILD
Created May 19, 2021 04:10
MediaPipe Holistic Tracking for Android
# Copyright 2019 The MediaPipe Authors.
#
# 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
# distributed under the License is distributed on an "AS IS" BASIS,
@mblondel
mblondel / kernel_kmeans.py
Last active January 4, 2024 11:45
Kernel K-means.
"""Kernel K-means"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.utils import check_random_state
@dacort
dacort / cookiemonster.go
Created September 23, 2014 06:51
Simple script to extract (encrypted) cookies out of Chrome OS X cookie store. Usage: ./cookiemonster domain.com
package main
import (
"code.google.com/p/go.crypto/pbkdf2"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"database/sql"
"fmt"
"log"
SSE3=1 SSSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0
Synopsis:
shell [options] [--shell] [<file>...]
d8 [options] [-e <string>] [--shell] [[--module] <file>...]
-e execute a string in V8
--shell run an interactive JavaScript shell
--module execute a file as a JavaScript module
Options:
@faithfracture
faithfracture / boost.sh
Last active October 6, 2023 21:23
Boost build script for iOS (armv7, armv7s, arm64), iOS Simulator (i386, x86_64), and OSX (i386, x86_64)
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for iOS, iOS Simulator, and OSX.
# Creates a set of universal libraries that can be used on an iOS and in the
@dominicthomas
dominicthomas / max_height_linear_layout.txt
Created December 8, 2016 12:23
Enables you to set a max height for a linear layout while also using wrap content.. this means the layout will be collapsable but also have height constraints!
public class MaxHeightLinearLayout extends LinearLayout {
private int maxHeightDp;
public MaxHeightLinearLayout(Context context) {
super(context);
}
public MaxHeightLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);