Skip to content

Instantly share code, notes, and snippets.

View RuNpiXelruN's full-sized avatar

Justin Davidson RuNpiXelruN

  • Sydney, Australia
View GitHub Profile
@RuNpiXelruN
RuNpiXelruN / depthfirstsearch.js
Created August 12, 2022 02:40
Depth first search
export function getActionBox(boxes: any[], id: number) {
let found = null
let i = boxes.length
while (i--) {
if (boxes[i].id.self === id) {
found = boxes[i]
return found
}
let j = boxes[i].children.length
while (j--) {
@RuNpiXelruN
RuNpiXelruN / randomColour
Created November 5, 2021 00:06
generate a random colour
randomColor() {
let letters = '0123456789ABCDEF'
let color = '#'
let i = 0
while (i < 6) {
color += letters[Math.floor(Math.random() * 16)]
i++
}
return `${color}44`
docker run \
-e NGROK_TOKEN=1pB7VzgNlpotPqUricmIlUP85v5_2gNWu4ytBU9M43wpqXciT \
-e GI_API_KEY=5667d12329b3ad64b5affd1f4aef714373b42aa5 \
-e GI_SUITE=6035a626fa81e86a715fa014 \
-e APP_PORT=10.0.0.4:3001 \
--network my-bridge-network \
ghostinspector/test-runner-standalone
@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"}
@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 / 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])
}
//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 / getRemoteBranches.md
Created April 8, 2019 04:28
refresh git cli remote branches
git branch --remote --list
git branch --remote --list | grep C-1114
//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
}

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: