Skip to content

Instantly share code, notes, and snippets.

View osdiab's full-sized avatar

Omar Diab osdiab

View GitHub Profile
@osdiab
osdiab / generate-all-translations.ts
Last active September 14, 2022 11:53
Type Safe remix-i18next
// this script reads through app/locales/*/*.json, copies them to public/locales,
// and generates a typescript file that can be used for making nice typings.
// it can be extended in the future to actually read the contents to allow for
// typesafe interpolation of variables.
import { join, relative } from "node:path";
import { cp, rm, writeFile } from "node:fs/promises";
import { promisify } from "node:util";
import { glob } from "glob";
import camelCase from "camelcase";
@osdiab
osdiab / snippet.html
Created July 28, 2021 22:53
Income Movement Donate Button Embed
<html>
<body>
<a href="https://www.every.org/incomemovement/donate">Donate!</a>
<script>
(function () {
document.addEventListener("DOMContentLoaded", function () {
document
.querySelector("#edoDonateButtonScript")
.addEventListener("load", () => {
@osdiab
osdiab / _README.md
Last active December 28, 2022 18:30
Deletes all your cached URLs in prerender

You can run this by doing the following:

  1. Log into https://prerender.io
  2. Open the developer console on the prerender site
  3. Copy the code in this gist and paste it into your console
  4. Hit enter!

Some notes:

  • This script takes a while, Prerender is not very performant! So if you have a lot of cached URLs, be patient.
@osdiab
osdiab / SketchSystems.spec
Last active March 1, 2019 07:27
Email Task App
Email Task App
Splash Page*
login -> Inbox
Inbox&
Thread List
Inbox Instance*
Drafts
select draft -> Go To Message?
// pages/WelcomePage.jsx
export function WelcomePage(props) {
return <h1>props.message</h1>;
}
// pages/AboutPage.jsx
export function AboutPage(props) {
return (<ul>
<li>props.teammate[0].name</li>
// pages/WelcomePage.jsx
export function WelcomePage(props) {
return <h1>props.message</h1>;
}
// pages/AboutPage.jsx
export function AboutPage(props) {
return (<ul>
<li>props.teammate[0].name</li>

Keybase proof

I hereby claim:

  • I am osdiab on github.
  • I am osdiab (https://keybase.io/osdiab) on keybase.
  • I have a public key whose fingerprint is F16E 7477 7610 192E 0F09 633A F4FC 5AA2 92FF 8FDD

To claim this, I am signing this object:

@osdiab
osdiab / piano_choices.md
Created November 17, 2015 22:34
Choices for a Clever digital piano

Digital piano suggestions

As aggregated from the Slack #piano channel.

Thoughts

  • Good hammer action is important.
  • Having at least a sustain pedal is important.
  • Headphone output necessary
  • Builtin speakers preferred
@osdiab
osdiab / gist:7638151
Created November 25, 2013 08:26
Rbx-2.2.1 Rubocop dump
An exception occurred running /Users/osdiab/.rvm/gems/rbx-2.2.1/bin/ruby_executable_hooks:
Parser does not support parsing Ruby 2.1.0 (NotImplementedError)
Backtrace:
{ } in Object(Module)#__script__ at /Users/osdiab/.rvm/gems/rbx-2.2.1/gems/parser-2.0.0/lib/parser/current.rb:32
Object#__script__ at /Users/osdiab/.rvm/gems/rbx-2.2.1/gems/parser-2.0.0/lib/parser/current.rb:1
Rubinius::CodeLoader.require at kernel/common/code_loader.rb:243
Kernel(Object)#require at kernel/common/kernel.rb:685
@osdiab
osdiab / .vimrc
Created October 31, 2013 23:41
vimrc
execute pathogen#infect()
set encoding=utf-8
" STATUSLINE
"recalculate the trailing whitespace warning when idle, and after saving
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
"return '[\s]' if trailing white space is detected
"return '' otherwise