Skip to content

Instantly share code, notes, and snippets.

@anson0370
anson0370 / pin.coffee
Created June 10, 2013 07:58
a jquery plugin to pin an element on any element u want
do ($=jQuery) ->
$.fn.pin = (target) ->
$target = if target
if typeof target == "function"
target.apply @
else
$(target)
else
$(@).parent()
@anson0370
anson0370 / mac_trick.sh
Last active December 18, 2015 18:59
mac秘笈
# 让QuickLook中的文字可以选取-开启和关闭
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;killall Finder
defaults delete com.apple.finder QLEnableTextSelection;killall Finder
# 强制mac字体渲染(非Apple家显示器有效)-设定/删除和查看
defaults -currentHost write -g AppleFontSmoothing -int 3 # 1-3档 轻-重
defaults -currentHost delete -g AppleFontSmoothing
defaults -currentHost read -g AppleFontSmoothing
# 隐藏的app在dock上虚化以区分-开启和关闭
a:link, a:visited, a:active {
color: #8e8d93;
-webkit-transition: all .15s;
-moz-transition: all .15s;
-ms-transition: all .15s;
-o-transition: all .15s;
transition: all .15s;
}
a.top:link, a.top:visited, a.top:active {
color: #000;
@anson0370
anson0370 / select.tsx
Created August 7, 2024 08:40
fix shadcn Select component for mobile
"use client"
import * as React from "react"
import * as SelectPrimitive from "@radix-ui/react-select"
import { Check, ChevronDown, ChevronUp } from "lucide-react"
import { cn } from "@/lib/utils"
const SelectContext = React.createContext<{ setOpen: (open: boolean) => void }>({
setOpen: () => {},