Skip to content

Instantly share code, notes, and snippets.

View RuNpiXelruN's full-sized avatar

Justin Davidson RuNpiXelruN

  • Sydney, Australia
View GitHub Profile
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
browserSync = require('browser-sync').create();
gulp.task('serve', ['sass'], function() {
browserSync.init({
@RuNpiXelruN
RuNpiXelruN / timer-countdown.js
Created March 5, 2019 05:37
simple JS timer countdown
timer () {
setTimeout(() => {
if (this.timeleft === 1) {
this.$router.push('/quote/offer')
return
}
this.timeleft--
this.timer()
}, 1000)
}
@RuNpiXelruN
RuNpiXelruN / arrays-merge.js
Created March 5, 2019 06:16
Merge two arrays into an object
const keys = [ "height", "width" ]
const values = [ "12px", "24px" ]
const merged = values.reduce((obj, value, index) => ({...obj, [keys[index]]: value}), {})

Keybase proof

I hereby claim:

  • I am runpixelrun on github.
  • I am runpixelrun (https://keybase.io/runpixelrun) on keybase.
  • I have a public key ASAYzJH71E1Yp_IUcOi8ZCRL7TwibGCNsM1eve5T1rZHOgo

To claim this, I am signing this object:

//plugins/api.js
import apiLayer from '~/api'
import delayResponse from './axios-delay'
export default (ctx, inject) => {
// inject the api in the context (ctx.app.$api)
// ..and can accessed in the Vue instances and store by (this.$api)
const errorCheck = status => {
return status < 200 && status >= 300
}
@RuNpiXelruN
RuNpiXelruN / getRemoteBranches.md
Created April 8, 2019 04:28
refresh git cli remote branches
git branch --remote --list
git branch --remote --list | grep C-1114
//template
<div class="picWrapper">
<h3>Update Image</h3>
<div class="image-flex-wrapper">
<input type="file" @change="previewImage" accept="image/*">
<div class="image-preview" v-if="!!imageData.length">
<img class="preview" :src="imageData" alt="">
</div>
<div class="image-preview" v-else>
@RuNpiXelruN
RuNpiXelruN / randString.go
Created May 22, 2020 10:57
Create a random string in Go
func randStr(len int) string {
buff := make([]byte, len)
rand.Read(buff)
str := base64.StdEncoding.EncodeToString(buff)
// Base 64 can be longer than len
return strings.ToLower(str[:len])
}
@RuNpiXelruN
RuNpiXelruN / baspath.go
Created June 3, 2020 06:04
Get basepath of app/workspace
_, b, _, _ := runtime.Caller(0)
basepath := filepath.Dir(b)
@RuNpiXelruN
RuNpiXelruN / cloudSettings
Created October 22, 2020 21:42
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-22T21:42:43.772Z","extensionVersion":"v3.4.3"}