This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const {EditorState} = require('prosemirror-state'); | |
const {Schema, Node} = require('prosemirror-model'); | |
const schema = new Schema({ | |
nodes: { | |
doc: { | |
content: 'block+', | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
# OS x only | |
function last_branchs { | |
readarray array <<< $(git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)') | |
FIVE_DAYS_AGO=$(date -v-5d "+%s") | |
for row in "${array[@]}";do | |
row_array=(${row}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
@keyframes wave { | |
0% { | |
font-variation-settings: 'wght' 100; | |
} | |
100% { | |
font-variation-settings: 'wght' 1000; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is in progress I tested it only on macOS 10.13.6 | |
# outuput e.g: | |
# PID (319) Spotify -> :57621 | |
function ports { | |
PORTS=$(lsof -iTCP -sTCP:LISTEN -nP) | |
echo "$PORTS" | awk 'match($9, /[\]|\*]+:(.*)$/) { print " PID ("$2") "$1" -> "substr($9, RSTART+1, RLENGTH-1) }' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First you need to install gcalcli please go to https://github.com/insanum/gcalcli | |
wg_next_event="#(gcalcli --military --nostarted agenda --nocolor | cut -d ' ' -f 2- | head -2 | tail -1 | cut -c1-40)" | |
set -g status-right "#[fg=colour15,bg=colour237,bold]📅 $wg_next_event" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License (MIT) | |
# | |
# Copyright (c) 2018 RatoX | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'Ola como vai <b>voce?\n Eu vou</b> <b>bem</b>' | |
str.replace(/<b>(.*?|[\s\S]*?)<\/b>/g, '**$1**') | |
// Result: "Ola como vai **voce?\n Eu vou** **bem**" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const matrix = [ | |
[ 0,0,1,0,1], | |
[ 1,1,0,1,1], | |
[ 0,1,0,1,0 ], | |
[ 0,1,1,1,1 ], | |
[ 1,0,1,0,1 ], | |
] | |
function checkZero (index_x, index_y, check) { | |
const temp = matrix[index_x] || [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function infinite(fn, ...args) { | |
function partial(...args2) { | |
return infinite(fn, ...args.concat(args2)); | |
} | |
partial.result = () => { | |
return fn(...args); | |
}; | |
return partial; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bulk replace for MAC | |
# ag <https://github.com/ggreer/the_silver_searcher> | |
# original idea: https://gist.github.com/hlissner/db74d23fc00bed81ff62 | |
# usage: replace [search] [replace] | |
function replace { | |
ag -0 -l "$1" | xargs -0 sed -i "" -E "s/$1/$2/g" | |
} |
NewerOlder