Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
👷

代码家 daimajia

💭
👷
View GitHub Profile
@Wilsonilo
Wilsonilo / HstackDragDrop.swift
Last active Jul 12, 2021
Drag and Drop SwiftUI with ScrollView and HStack
View HstackDragDrop.swift
//: HSTack /Scroll View With Drag and Drop
// By Wilson Munoz / @yosoywil
// Inspiration 1: https://gist.github.com/tarasis/f9bac6d98de5433f1ddbadaef02f9a29
// Inspiration 2: https://swiftui-lab.com/drag-drop-with-swiftui/
// Really dirty but functional, need to stress test with several items in the ScrollView/HStack and check memory.
import SwiftUI
import PlaygroundSupport
import Combine
@ahgood
ahgood / gist:4d53f6d9ac1f3c593255fd20b15407e1
Created Sep 2, 2017
Setting up proxy(Shadowsocks, socket 5) for Google Backup and Sync(Google Photos Mac App)
View gist:4d53f6d9ac1f3c593255fd20b15407e1
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
sudo nano /etc/proxychains.conf
add this code to the end of proxychains.conf: socks5 127.0.0.1 1080
proxychains4 open -a /Applications/Backup\ and\ Sync.app
@jkwiecien
jkwiecien / retrofit2_rxjava_proguard_config
Last active Sep 15, 2020
Retrofit2 + RxJava proguard config.
View retrofit2_rxjava_proguard_config
########--------Retrofit + RxJava--------#########
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-dontwarn sun.misc.Unsafe
-dontwarn com.octo.android.robospice.retrofit.RetrofitJackson**
-dontwarn retrofit.appengine.UrlFetchClient
-keepattributes Signature
-keepattributes Exceptions
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;
@dgp
dgp / youtube api video category id list
Created Jun 11, 2015
youtube api video category id list
View youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@gabrielemariotti
gabrielemariotti / README.md
Last active Nov 24, 2021
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.
View README.md

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

View CollapsingTitleLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
View local_manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="ssh://git@d2tehp.chickenkiller.com:22123" name="gitlab" />
<remote fetch="git://codeaurora.org/quic/la/" name="caf" />
<project name="CyanogenMod/hudson" path="hudson" remote="github" revision="master" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" />
<project name="TheMuppets/proprietary_vendor_lge" path="vendor/lge" remote="github" />
View CircularProgressDrawable.java
public class CircularProgressDrawable extends Drawable
implements Animatable {
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator();
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator();
private static final int ANGLE_ANIMATOR_DURATION = 2000;
private static final int SWEEP_ANIMATOR_DURATION = 600;
private static final int MIN_SWEEP_ANGLE = 30;
private final RectF fBounds = new RectF();
View FloatLabelLayout.java
/*
* Copyright 2014 Chris Banes
*
* 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
View global project gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}