Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Marc Cornellà mcornella

💭
I may be slow to respond.
View GitHub Profile
@mcornella
mcornella / omzrainbow.zsh
Last active May 17, 2020
Oh My Zsh logo in rainbow colors
View omzrainbow.zsh
#!/usr/bin/env zsh
omz_rainbow() {
local red=${(%):-%F{196}} orange=${(%):-%F{202}} yellow=${(%):-%F{226}}
local green=${(%):-%F{082}} blue=${(%):-%F{021}} indigo=${(%):-%F{093}}
local violet=${(%):-%F{163}} reset=$(printf '\033[m')
printf '%s %s__ %s %s %s %s %s__ %s\n' $red $orange $yellow $green $blue $indigo $violet $reset
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $red $orange $yellow $green $blue $indigo $violet $reset
printf '%s / __ \%s/ __ \ %s / __ `__ \%s/ / / / %s /_ / %s/ ___%s/ __ \ %s\n' $red $orange $yellow $green $blue $indigo $violet $reset
@mcornella
mcornella / dotheshining.zsh
Last active Apr 14, 2020
Some stupid shit
View dotheshining.zsh
#!/usr/bin/env zsh
randcase() {
local line ch z=$RANDOM
while read line; do
if [[ $z -lt 10000 ]]; then
echo ${(U)line}
elif [[ $z -lt 20000 ]]; then
echo ${(L)line}
else
@mcornella
mcornella / script.js
Last active Oct 12, 2019
Allow use of middle click (wheel click) to open quoted tweets
View script.js
function openquotedtweet(e) {
// Taken from https://stackoverflow.com/a/39165137/5798232
function FindReact(dom) {
let key = Object.keys(dom).find(key=>key.startsWith("__reactInternalInstance$"));
let internalInstance = dom[key];
if (internalInstance === null) return null;
if (internalInstance.return) { // react 16+
return internalInstance._debugOwner
? internalInstance._debugOwner.stateNode
@mcornella
mcornella / bookmark.md
Last active May 27, 2020
Inbox by Google bookmarklet
View bookmark.md

Go to inbox.google.com.mcornella.com, or drag this to your bookmarks and change the name to Inbox by Gmail:

data:text/html,<!DOCTYPE html><html lang="en"><head><meta charset="utf8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="description" content="Google Inbox replacement to help with attachment issues."><meta name="theme-color" content="%23FFFFFF"><title>Inbox by Gmail</title><style>@font-face {font-family: "Roboto";font-style: normal;font-weight: 400;font-display: swap;src: local("Roboto"), local("Roboto-Regular"), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxK.woff2) format("woff2");unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}@font-face {font-family: "Roboto";font-style: normal;font-weight: 700;font-display: swap;src: local("Roboto Bold"), local("Roboto-Bold"), url(https://fonts.gs
@mcornella
mcornella / .gitignore
Last active Jun 30, 2020
Stats and PR triage for ohmyzsh
View .gitignore
github
pulls
repo
stats
types
*.txt
.env
@mcornella
mcornella / Makefile
Last active Apr 11, 2016
ZSH wait() syscall test bench for #BashOnUbuntuOnWindows. See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-208077623
View Makefile
.PHONY: all test clean
.IGNORE: test
all: wait3_getrusage wait3 waitpid wait
wait3_getrusage: main.c
gcc main.c -D HAVE_WAIT3 -D HAVE_GETRUSAGE -o wait3_getrusage
wait3: main.c
@mcornella
mcornella / build-zsh.txt
Last active Jun 6, 2016 — forked from thiagokokada/build-zsh.sh
This workaround is obsolete, build 14342 solves the issue. Please use that build instead. See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
View build-zsh.txt
# THIS HAS BECOME OBSOLETE. IN BUILD 14342 THIS IS SOLVED, PLEASE USE THAT BUILD INSTEAD (OR MORE RECENT ONES)
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-218379746
# Workaround to build ZSH on #BashOnUbuntuOnWindows.
# See https://github.com/Microsoft/BashOnWindows/issues/91#issuecomment-208077623
# RUN EACH LINE INDEPENDENTLY. THIS IS NOT AN AUTOMATIC BASH SCRIPT.
# Install dependencies
apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall
You can’t perform that action at this time.