Skip to content

Instantly share code, notes, and snippets.

View russweas's full-sized avatar
🦀

Russ Weas russweas

🦀
View GitHub Profile
@russweas
russweas / merge.yaml
Created September 8, 2021 20:49
GH Action to automatically build docs & compile sqlx-data.json
name: Merge Assist
defaults:
run:
working-directory: api
on:
push:
branches:
- main
paths:
@russweas
russweas / conn.go
Last active March 11, 2021 20:38
conn.go
conn.SetReadDeadline(time.Now().Add(2000 * time.Millisecond))
edgeData, err := bufio.NewReader(conn).ReadString('\n') // Wait for next piece of data
if err == io.EOF {
return
}
// if err == ??? { // This is a timeout }
if err != nil {
log.Println(err)
break
}
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"profiles": [
{
@russweas
russweas / mixins.styl
Last active December 21, 2018 06:26
Stylus BEM mixins
// Mixins.styl
has($name)
/&__{$name}
{block}
variant($name)
/&--{$name}
{block}
call: (view, funcName, args...) ->
if @views[view].ready then @views[view]['model'][funcName].apply(null, args)
else @views[view].funcs.push({name: funcName, args: args})
// app.js call method.
call: function(view, name, args = []) {
if(this.viewData[view].ready == true) {
this.viewData[view].model[name](args);
} else {
this.viewData[view].funcs_to_call.push({name: name, args: args});
}
}
// updated for loop inside each view
...
<body id="mainApp">
<component is="@{{ currentView }}" app="@{{@ app }}" keep-alive></component>
</body>
...
var Vue = require('vue');
var app = new Vue({
el: 'body#mainApp',
data: {
currentView: 'loading-view',
app: {},
viewData: {
'edit-view': {
module.exports = {
data: function() {
return {
external: {}
};
},
props: [
'app'
],
var methods = this.app.viewData[view].funcs_to_call;
for(var i in methods)
{
this[methods[i]]();
}