Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
out here livin

Amadeus Demarzi amadeus

🕶️
out here livin
View GitHub Profile
View example.js
const memTester = (() => {
const api = {
_timer: null,
start() {
if (api._timer != null) {
api.end();
}
let back = true;
api._timer = setInterval(() => {
if (back) {
View Dispatcher.js
if (this._interceptor == null || !this._interceptor(action)) {
mark(action.type);
this._currentDispatchActionType = action.type;
try {
const actionHandlers =
this._orderedActionHandlers[action.type] || this._computeOrderedActionHandlers(action.type);
for (let i = 0, l = actionHandlers.length; i < l; i++) {
const {actionHandler, storeDidChange} = actionHandlers[i];
if (actionHandler(action) !== false) {
storeDidChange(action);
View build.sh
#!/bin/bash
make clean
make distclean
# ./configure --with-features=huge --enable-terminal --enable-rubyinterp --enable-python3interp --enable-perlinterp --enable-cscope
./configure --with-features=huge --enable-terminal --enable-rubyinterp --enable-python3interp --enable-perlinterp --enable-cscope --enable-luainterp=yes --with-lua-prefix=/usr/local/Cellar/lua/5.3.5_1
make
rm src/MacVim/build/Release/MacVim.app/Contents/Resources/MacVim.icns
cp ./MacVim.icns src/MacVim/build/Release/MacVim.app/Contents/Resources/
open src/MacVim/build/Release
View import-export.js
// Default export
// Export from file.js
const ExampleSomething = {};
export default ExampleSomething;
// import from another.js
import ExampleSomething from './file.js';
// Named Exports
// Export from file.js
export const Another = {};
View windows-timers.md

Fixing Windows Wake Timers

  • Download psexec
  • From Command Prompt in administrator mode (right click from search launcher)
  • Useful link Windows Timers Bullshits
  • To view current powercfg -waketimers
  • psexec.exe -i -s %windir%\system32\mmc.exe /s taskschd.msc
    • Brings up a funky UI to fix some waketimers
    • Event Viewer (Local) -> Windows Logs -> System (Right click -> Filter Current Log) -> Event sources: Power-Troubleshooter -> Ok
View example.vimrc
" Base .vimrc file
if has('vim_starting')
set nocompatible
endif
" Ensure all directories are setup properly and download plug.vim
if empty(glob('~/.vim/autoload/plug.vim'))
execute '!mkdir -p ~/.vim/bundle ~/.vim/backup ~/.vim/swap ~/.vim/cache ~/.vim/undo ~/.vim/autoload ~/.vim/bundle'
execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
@amadeus
amadeus / prettier.json
Created Jan 1, 2019
.prettierrc template
View prettier.json
{
"printWidth": 120,
"trailingComma": "es5",
"bracketSpacing": false,
"singleQuote": true,
"jsxBracketSameLine": true,
"overrides": [
{
"files": ["*.css", "*.styl"],
"options": {
@amadeus
amadeus / lvimrc.vim
Last active Dec 23, 2019
.lvimrc template
View lvimrc.vim
" NOTE: Only source this file once per session
if g:localvimrc_sourced_once
finish
endif
echom '{page} .lvimrc has been sourced'
set tabstop=2
set shiftwidth=2
set expandtab
View mvim
#!/bin/sh
#
# This shell script passes all its arguments to the binary inside the
# MacVim.app application bundle. If you make links to this script as view,
# gvim, etc., then it will peek at the name used to call it and set options
# appropriately.
#
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
# Weber and Bjorn Winckler, Aug 13 2007).
View vimrc.vim
let g:hl_was_on = 0
function! ToggleHLSearch(enter)
if a:enter == 1 && v:hlsearch == 1
let g:hl_was_on = 1
elseif a:enter == 1
let g:hl_was_on = 0
set hlsearch
elseif a:enter == 0 && g:hl_was_on == 0
let g:hl_was_on = 0
set nohlsearch
You can’t perform that action at this time.