Skip to content

Instantly share code, notes, and snippets.

@msmiley
msmiley / cloneDeepNoFunctions
Created October 8, 2019 13:36
js cloneDeepNoFunctions
exports.cloneDeepNoFunctions = function(obj) {
let ret;
// set up recursion for arrays and objects
if (Array.isArray(obj)) {
ret = [];
// iterate
for (let v of obj) {
if (typeof(v) === 'function') {
continue;
@msmiley
msmiley / TabsWithAdvancedTitles.vue
Last active February 10, 2018 18:04
Vue component rendered into bootstrap-vue tab title prop
<template>
<b-tabs>
<b-tab :title="getTabLabel('<param>')" active></b-tab>
</b-tabs>
</template>
<script>
import TabLabelComponent from 'TabLabel.vue'
export default {
export NODE_VERSION=9.5.0 && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" && tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 && rm "node-v$NODE_VERSION-linux-armv7l.tar.gz" && npm install -g node-gyp && npm cache verify
@msmiley
msmiley / nodejs
Created October 2, 2017 12:45
nodejs
export NODE_VERSION=8.6.0 && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 && rm "node-v$NODE_VERSION-linux-x64.tar.gz" && npm install -g node-gyp && npm cache verify
@msmiley
msmiley / randomHeatMap.coffee
Created March 3, 2017 16:58
year of random data for testing/demoing heat map calendars
_generateRandomHeatMap = ->
now = moment.tz(Settings.get().timeZone).endOf('day').toDate()
yearAgo = moment.tz(Settings.get().timeZone).startOf('day').subtract(1, 'year').toDate()
# use utc
d3.timeDay.range(yearAgo, now).map (d) ->
if 0 < moment(d).weekday() < 6
num = Math.floor(Math.random() * 20)
else
num = Math.floor(Math.random() * 5)
@msmiley
msmiley / docker-rmi-orphans
Created February 24, 2017 16:50
docker rmi orphaned images
docker rmi `docker images | grep '^<none>' | awk '{ print $3 }'`

edit

/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist

and add:

Customized
@msmiley
msmiley / gist:b57ab4bea89ef6178518
Created February 1, 2015 00:24
change author on all git commits in a branch
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "<old email>" ]
then
cn="<new name>"
cm="<new email>"