Skip to content

Instantly share code, notes, and snippets.

; Globals
DesktopCount = 3 ; Windows starts with 2 desktops at boot
CurrentDesktop = 1 ; Desktop count is 1-indexed (Microsoft numbers them this way)
;
; This function examines the registry to build an accurate list of the current virtual desktops and which one we're currently on.
; Current desktop UUID appears to be in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\1\VirtualDesktops
; List of desktops appears to be in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops
;
mapDesktopsFromRegistry() {
global CurrentDesktop, DesktopCount
/* Workaround for vim-vixen issue
* https://github.com/ueokande/vim-vixen/issues/1424
*/
.vimvixen-console-frame {
height: 0px;
color-scheme: light !important;
}
/* i really want this to be global */
const AnotherComponent = defineComponent(
() => {
const text = atom('');
return { text }
},
() => (
<input />
)
)
function Demo() {
const loginForm = useForm({
email: ['', [Validators.required]],
username: ['', [Validators.required, AsyncUsernameUniquenessValidator]],
password: ['', [PasswordStringValidator]],
contacts: [[], [Validators.minLength(1)],
);
const onLogin = useCallback((values) => {
console.log("=== form values", values);
})
const products = state([{name: 'ABC', authorID: 1}]);
const users = state([{ID: 1, name: 'Tom'}]);
const productWithUsers = computed(() => products.value.map(p => {
const user = users.find(u => u.ID === p.authorID);
return {...p, author: user};
})))
import { ComponentType } from "react";
type GetProps<C> = C extends ComponentType<infer P> ? P : never;
type Matching<InjectedProps, DecorationTargetProps> = {
[P in keyof DecorationTargetProps]: P extends keyof InjectedProps
? InjectedProps[P] extends DecorationTargetProps[P]
? DecorationTargetProps[P]
: InjectedProps[P]
: DecorationTargetProps[P];
@IniZio
IniZio / react-reim.tsx
Last active December 16, 2021 17:28
Reim V4
function Counter() {
const { data: { count }, fire } = useReim(counter);
return (
<div>
<button onClick={() => fire(Increment)}>-</button>
<input value={count} />
<button onClick={() => fire(Decrement)}>-</button>
</div>
)
### Keybase proof
I hereby claim:
* I am inizio on github.
* I am newman_oursky (https://keybase.io/newman_oursky) on keybase.
* I have a public key whose fingerprint is 3360 6C47 9B14 ECFE 6081 3E72 A90C 9856 22FD 8990
To claim this, I am signing this object:
FROM node:12 as builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:1.12-alpine
@IniZio
IniZio / react-side.jsx
Last active October 31, 2019 15:49
mirco-frontend
export default () => {
return {
mount: async el => {
const App = await await import('./App')
const Wrapper = C => {
let setter
return () => {
const [state, setState] = useState()
setter = setState