Skip to content

Instantly share code, notes, and snippets.

{"version":1,"resource":"file:///Users/kolenov/.zshrc","entries":[{"id":"NV7r","timestamp":1675354832562},{"id":"Vi4I","timestamp":1675356374621},{"id":"0vPa","timestamp":1675356436195},{"id":"Ov0g","timestamp":1675783966422},{"id":"tAi8","timestamp":1675785140512},{"id":"DHiL","timestamp":1675785165724},{"id":"DPDI","timestamp":1675786467175},{"id":"AUqQ","timestamp":1675813801713},{"id":"cXDt","timestamp":1679325241714},{"id":"6Stb","source":"Workspace Edit","timestamp":1679325302496},{"id":"9IIV","timestamp":1679325346714},{"id":"CFjt","timestamp":1679325395718},{"id":"pppK","timestamp":1679325410072},{"id":"tnqU","timestamp":1679326486820},{"id":"L2hs","timestamp":1679329507096},{"id":"3hkJ","timestamp":1680014858200},{"id":"dlKf","timestamp":1680014923277},{"id":"L5Nv","timestamp":1680014963036},{"id":"s599","timestamp":1680041870593},{"id":"EmHd","timestamp":1680041883841},{"id":"PR1i","source":"undoRedo.source","timestamp":1680041886065},{"id":"m8fP","timestamp":1680041890687},{"id":"qIB7","timestamp":
const originalConsoleError = console.error;
console.error = message => {
if (/(Failed prop type)/.test(message)) {
throw new Error(message);
}
originalConsoleError(message);
};
@Kolenov
Kolenov / utils.js
Last active May 2, 2023 16:28
Recompose replacenent
const renderComponent = R.curryN(2, React.createElement)
const setDisplayName = displayName => R.tap(C => { C.displayName = displayName })
const hasProperty = (prop, obj) => Object.prototype.hasOwnProperty.call(obj, prop);
const renderNothing = () => () => null
const renderComponent = Component => () => {
const RenderComponent = props => createElement(Component)(props)
if (process.env.NODE_ENV !== 'production') {
const name = Component && Component.name + '(renderComponent)' || 'renderComponent'
@Kolenov
Kolenov / AbortController.js
Created October 1, 2021 09:19
AbortController
useEffect(() => {
const abortController = new AbortController() // creating an AbortController
fetch(url, { signal: abortController.signal }) // passing the signal to the query
.then(data => {
setState(data) // if everything went well, set the state
})
.catch(error => {
if (error.name === 'AbortError') return // if the query has been aborted, do nothing
throw error
})
@Kolenov
Kolenov / AuthContent.js
Last active September 10, 2021 12:33
React, MobX and Ramda conditional rendering
const enhance = R.compose(
inject('store'),
observer
)
const AuthContent = (props => R.cond([
[R.equals(Page.signin), () => <SignIn {...props}/>],
[R.equals(Page.signup), () => <SignUp {...props}/>],
[R.equals(Page.confirm), () => <PasswordResetConfirm {...props}/>],
[R.equals(Page.forgot), () => <PasswordReset {...props}/>],
@Kolenov
Kolenov / autoexec.cfg
Created April 23, 2021 12:08 — forked from Fyzu/autoexec.cfg
Apex Legends autoexec
rspn_motd "Aimbot activated (joke)"
//=====================================================
//================== 4:3; 5:4 FIX =====================
//=====================================================
//mat_letterbox_aspect_goal 0.0 // Растягивает картинку на старых мониторах с соотношением сторон 4:3; 5:4 или нестандартных(кастомных) разрешениях, убирает черные полосы по бокам. (ВЫКЛ, для ВКЛ.убрать "//")
//mat_letterbox_aspect_threshold 0.0 // Растягивает картинку на старых мониторах с соотношением сторон 4:3; 5:4 или нестандартных(кастомных) разрешениях, убирает черные полосы по бокам. (ВЫКЛ, для ВКЛ.убрать "//")
//=====================================================
; --------------------------------------------------------------
; NOTES
; --------------------------------------------------------------
; ! = ALT
; ^ = CTRL
; + = SHIFT
; # = WIN
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
@Kolenov
Kolenov / Mac OS X 10_5_ Windows Ctrl.xml
Created October 18, 2020 23:15 — forked from fljot/Mac OS X 10_5_ Windows Ctrl.xml
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">
@Kolenov
Kolenov / README.md
Created October 18, 2020 22:52 — forked from ascendbruce/README.md
Use mac style shortcuts on Windows with AutoHotkey (ahk) script

Use (most) macOS style shortcuts on Windows

Make Windows PC's shortcut act like macOS (Mac OS X)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

Note that

  1. You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys because it conflicts with cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line)
  2. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
export class ReducerPool {
constructor() {
this.redusers = [];
}
registerReducer(reducer) {
redusers.push(reducer);
}
getNewState(state, action) {