Skip to content

Instantly share code, notes, and snippets.

@debuggerx01
debuggerx01 / visible_items_of_listview.dart
Last active July 2, 2024 08:03
Visible Items of ListView Demo
import 'package:flutter/material.dart';
import 'package:rect_getter/rect_getter.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Visible Demo',
@Teraflopst
Teraflopst / get_selected_files_dirs_path.scpt
Last active June 13, 2020 02:59
AppleScript:获取选中文件(夹)的目录路径
-- 脚本介绍
-- 功能:获取所选文件、文件夹的目录路径,支持多选
-- 如果仅仅想获取文件的目录路径,可以调用 isDirectory() 过滤掉文件夹的路径
tell application "Finder" to set selectedItems to selection as alias list
-- 没选择的话直接退出脚本
if selectedItems is {} then return
-- 获得所选文件/文件夹的父目录。
set parentPath to do shell script "dirname " & quoted form of POSIX path of (item 1 of selectedItems)
-- 用于拼接多个路径
@koesie10
koesie10 / ApiModule.java
Created October 3, 2015 07:40
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()