Skip to content

Instantly share code, notes, and snippets.

View rockyzhang24's full-sized avatar
🎯
Focusing

Rocky Zhang rockyzhang24

🎯
Focusing
View GitHub Profile

React.js Github Repo Spammed

Background

React's official website makes a banner, which offers visitors a way to provide humanitarian aid to Ukraine.
React的官方网站做了一个横幅,为访问者提供了向乌克兰提供人道主义援助的途径。

telegram-cloud-photo-size-5-6127611897286078767-x

Then, many people went to the React.js Github repository and opened lots of spam issues with anti-US and anti-Ukrainian comments in an apparent form of digital protest. The messages are in English and Mandarin.
然后,很多人到React.js Github 仓库中开了很多带有反美国和反乌克兰 issue,进行一种数字化的抗议。这些信息是用英语和普通话写的。

@davidatsurge
davidatsurge / luasnip_config.lua
Last active January 15, 2023 13:22
luasnip+treesitter snippet that fills in prop names when creating new react component
local ls = require("luasnip")
local fmt = require("luasnip.extras.fmt").fmt
local s = ls.snippet
local i = ls.insert_node
local f = ls.function_node
local d = ls.dynamic_node
local sn = ls.snippet_node
local rep = require("luasnip.extras").rep
-- Get a list of the property names given an `interface_declaration`
@rbitr
rbitr / random_notes.md
Last active November 10, 2023 16:34
Confusion about using $RANDOM to generate random numbers

Random numbers in bash et al

There is a variable $RANDOM than you can read in bash or zsh to get a random number beteen 0 and 32767. Here in zsh on my (old) mac:

% echo $RANDOM
13757
% echo $RANDOM
16896
@ofseed
ofseed / python.lua
Last active August 3, 2023 04:21
Python snippets from PyCharm
-- Same with text node, used for function nodes
local function text_same_with(args)
return args[1]
end
-- Same with text node, used for dynamic nodes
local function insert_same_with(args)
return sn(nil, {
i(1, args[1]),
})
@ofseed
ofseed / javascript.lua
Created August 3, 2023 08:54
JavaScript snippets from IntelliJ
local insert_same_with_and_append = function(args, _, _, user_arg1)
return sn(nil, {
i(1, args[1][1] .. user_arg1),
})
end
local arf
local assert = s(
{
@gruber
gruber / Split Tabs to New Window.scpt
Last active May 5, 2024 16:58
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,