Skip to content

Instantly share code, notes, and snippets.

View fimars's full-sized avatar
🍊

fimars fimars

🍊
View GitHub Profile
SELECT
*
FROM
people
WHERE
(
(first_name > 'Aaron') -- Names after Aaron
OR
(first_name = 'Aaron' AND id > 25995) -- Aarons, but after the last id that the user saw
)
@fimars
fimars / ace-theme.json
Created January 5, 2025 11:07
Ace in vscode
{
"name": "Ace-TM Theme",
"type": "dark",
"colors": {
"editor.background": "#352e3c",
"editor.foreground": "#d6dbd8",
"editorGutter.background": "#352e3c",
"editorGutter.foreground": "#7d817f",
"editorCursor.foreground": "#eee",
"editor.lineHighlightBackground": "rgba(0, 0, 0, 0.07)",
@fimars
fimars / spring.tsx
Created December 31, 2024 19:14
spring, scrollvalue, test
import React, { useRef, useEffect, useState } from 'react';
// useScrollValue 钩子
function useScrollValue() {
const [scrollY, setScrollY] = useState(window.scrollY);
useEffect(() => {
const handleScroll = () => {
window.requestAnimationFrame(() => setScrollY(window.scrollY));
};
@fimars
fimars / skip-xdg-open.bash
Created December 27, 2024 06:45
xdg-open error
mkdir ~/tmp-bin && export PATH=$PATH:~/tmp-bin && echo "#!/bin/sh" > ~/tmp-bin/xdg-open && chmod +x ~/tmp-bin/xdg-open
SELECT * FROM `table` WHERE shop_name = 'shopname' AND `table`.`is_delete` = 0 ORDER BY `table`.`id` LIMIT 10
SELECT * FROM `table` WHERE shop_name = 'shopname' AND `table`.`id` > 11087349 AND `table`.`is_delete` = 0 ORDER BY `table`.`id` LIMIT 10
SELECT * FROM `table` WHERE shop_name = 'shopname' AND `table`.`id` > 11087359 AND `table`.`is_delete` = 0 ORDER BY `table`.`id` LIMIT 10
@fimars
fimars / unique_symbol.ts
Created October 25, 2024 03:11
FIX `A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.ts(1170)`
type PlanName = 'free' | 'starter' | 'growth' | 'plus'
type PlanDuration = 'monthly' | 'annually'
type BillingPlanEvent = `billing_${PlanName}_${PlanDuration}_click`
type GuidacneStep = 1 | 2 | 3
type GuidanceEvent = `guidance_step${GuidacneStep}_next_click`
// A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.ts(1170)
// Fix?
❯ pnpm dlx @biomejs/biome format --write
const stylesheets = {};
export const injectStyles = ({ fileScopeId, css, mountNode = document.head }) => {
let stylesheet = stylesheets[fileScopeId];
if (!stylesheet) {
const styleEl = document.createElement('style');
styleEl.setAttribute('type', 'text/css');
stylesheet = stylesheets[fileScopeId] = styleEl;
// @ts-nocheck
import Plan from 'src/store/plan'
import packagePrivileges from 'src/common/constants/packagePrivileges'
import objectExt from 'src/utils/objectExt'
import { Box, Button } from '@vec6/next-ui'
import links from 'src/common/constants/links'
import User from 'src/store/user'
export default {
@fimars
fimars / Input.vue
Last active December 4, 2018 01:48
Vue Component Base Native Element Example
<script>
export default {
name: 'UInput',
render () {
// TODO: abstract node render useful function.
const attrs = this.$attrs;
const on = Object.keys(this.$listeners).reduce((events, key) => {
events[key] = (ev) => {
this.$emit(key, ev);
};