Skip to content

Instantly share code, notes, and snippets.

View elado's full-sized avatar
👨‍💻

Elad Ossadon elado

👨‍💻
View GitHub Profile
@elado
elado / README.md
Last active April 9, 2024 03:19
American Express - Add all offers to card at once (bookmarklet)

American Express - Add all offers to card at once

If you own an AMEX card, you can add a bunch of offers to the card in this link: https://global.americanexpress.com/offers/eligible

There are many offers, and they change all the time. Instead of clicking "Add to card" repeatedly, I created this bookmarklet.

In Chrome, add a new bookmark (right click on bookmarks bar -> "Add Page...") with the following URL:

@elado
elado / mac.ahk
Created September 4, 2020 05:47
macOS Keyboard Binding on Windows With AuthoHotKey
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; CMD+Backspace -> delete to start of line
#BS::Send {LShift down}{Home}{LShift Up}{Del}
; Alt+Backspace -> delete to start of word
@elado
elado / ts-type-map.ts
Created November 2, 2021 17:31
TypeScript type maps
export enum EnumType {
Foo = 'Foo',
Bar = 'Bar',
}
export interface MapEnumTypeToDataType {
[EnumType.Foo]: { x: string };
[EnumType.Bar]: { y: string };
}
@elado
elado / vscode-fileutils-keybindings.json
Created November 7, 2018 06:25
VSCode FileUtils + File Explorer KeyBindings
[
{
"key": "d",
"command": "fileutils.duplicateFile",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
{
"key": "r",
"command": "fileutils.moveFile",
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
@elado
elado / github-pr-mark-files-as-viewed.js
Last active June 23, 2021 19:51
GitHub mark files as viewed in a pull request
ignore = /packages\/.+\/(.eslintignore|package.json|jest.config.js)/
clicks = $$('.js-toggle-user-reviewed-file-form').filter(f => !f._method && ignore.test(f.path.value)).map(f=>f.querySelector('input[type="checkbox"]'))
randomSleep = () => new Promise(r => setTimeout(r, Math.random() * 50))
while (clicks.length) { await randomSleep(); console.log('marking as viewed...', clicks.length, ' to go'); clicks.pop().click() }
@elado
elado / a.md
Last active April 20, 2021 18:23
Next.js LESS CSS support (for AntD)
@elado
elado / cequel-database_cleaner.rb
Last active April 8, 2021 08:25
Cequel + DatabaseCleaner and RSpec
# in spec_helper.rb
RSpec.configure do |config|
records = []
config.before :suite do
Cequel::Record.descendants.each do |klass|
klass.after_create {|r| records << r }
end
end
@elado
elado / _bem-mixins.scss
Last active February 29, 2020 15:27
Advanced BEM SASS Mixins
@mixin reset {
&, * {
margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;
box-sizing: border-box; min-height: 0; min-width: 0;
ul { list-style: none; }
button { width: auto; height: auto; border: 0; background-color: transparent; cursor: pointer; outline: none; line-height: 1; }
}
}
$bem-use-namespace: false !default;
@elado
elado / Sublime Text Packages.md
Created May 13, 2017 20:54
Sublime Text Packages
  • Alignment
  • ApplySyntax
  • AutoBackups
  • BracketGuard
  • BracketHighlighter
  • Case Conversion
  • Color Highlighter
  • ColorPicker
  • ColorSchemeSelector
  • Console Wrap for js
@elado
elado / 01_indexedListReducerGenerator.js
Last active March 24, 2019 17:44
Redux Indexed List Reducer Generator
import shallowequal from 'shallowequal'
import _ from 'lodash'
export const LIST_UPSERT = '@@list/LIST_UPSERT'
export const LIST_DELETE = '@@list/LIST_DELETE'
const ids = (state=[], action) => {
switch (action.type) {
case LIST_UPSERT: {
const hasAt = typeof action.at !== 'undefined'