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/bin/env bash | |
if [[ "${1}" == "" ]]; then | |
echo "must provide a process" | |
exit 1 | |
fi | |
while : | |
do | |
ps -o rss "${1}" | tail -1 | numfmt --to=si |
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 _get = function(object, path, defaultVal) { | |
const _path = Array.isArray(path) | |
? path | |
: path.split('.').filter(i => i.length) | |
if (!_path.length || object === undefined) { | |
return object === undefined ? defaultVal : object | |
} | |
return _get(object[_path.shift()], _path, defaultVal) |
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
// unique array of objects by specific key | |
const uniqBy = function (arr, key) { | |
let seen = new Set() | |
return arr.filter(it => { | |
let val = it[key] | |
if (seen.has(val)) { | |
return false | |
} else { | |
seen.add(val) |
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
// takes an array of objects, an array of properties to sort by, | |
// and optionally a case-sensitive parameter (defaults to false) | |
// returns an array sorted by the given properties, in order. | |
const sortBy = function(arr, props, sensitive = false) { | |
// make sure we have an array. | |
if (!Array.isArray(props)) { | |
props = [props] | |
} |
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 uniq(arr) { | |
let result = [] | |
let seen = new Set() | |
for (let val of arr) { | |
if (!seen.has(val)) { | |
seen.add(val) | |
result.push(val) | |
} | |
} |
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
// convert a string of markdown that has anchor tags into it to have the rendered anchor tags | |
const html = `your markdown goes here` | |
const r = /\[(.*)\]\((.*)\)/gmi | |
function linkReplacer(match, p1, p2) { | |
return `<a href="${p2}" target="_blank" rel="nofollow noreferrer">${p1}</a>` | |
} | |
const newHtml = html.replace(r, linkReplacer) |
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
<template lang="html"> | |
<div :style="progress"></div> | |
</template> | |
<script> | |
export default { | |
name: 'ScrollProgress', | |
data() { | |
return { | |
scrollY: 0, |
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
module.exports = { | |
config: { | |
shell: '/usr/local/bin/fish', | |
updateChannel: 'canary', | |
fontSize: 15, | |
lineHeight: 1.2, | |
fontWeight: 'normal', | |
fontWeightBold: 'normal', | |
fontFamily: 'Fira Mono', | |
cursorShape: 'UNDERLINE', |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
/* hot pink from HTML5 boilerplate */ | |
.hotpink { | |
color: #fe57a1; | |
} |
NewerOlder