This file contains hidden or 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 attributesToInline = ['flex', 'flex-basis', 'flex-direction', 'flex-grow', 'display', 'max-width', 'max-height', 'overflow-y', 'overflow-x']; | |
function inlineStyles(element) { | |
// Get computed styles of the element | |
const computedStyle = window.getComputedStyle(element); | |
let styleString = ''; | |
for (const attr of attributesToInline) { | |
const value = computedStyle.getPropertyValue(attr); | |
if (value) { | |
if ((attr == "overflow-x" || attr == "overflow-y") && value == "visible") { |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"sort" |
This file contains hidden or 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
package main | |
type Config struct { | |
Includes []string | |
UserDbConfig userdb.Config | |
Port int | |
} |
This file contains hidden or 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
package userdb | |
type Config struct { | |
URL string | |
MaxIdleConnections int | |
MaxOpenConnections int | |
ConnMaxLifetime int | |
Replica bool | |
} |
This file contains hidden or 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
{ | |
"Includes": [ | |
"userdb_conf.json" | |
], | |
"Port": 3000 | |
} |
This file contains hidden or 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
{ | |
"UserDbConfig": { | |
"URL": "user=groupsio password=dev host=127.0.0.1 dbname=userdb", | |
"MaxIdleConnections": 1, | |
"MaxOpenConnections": 10, | |
"ConnMaxLifetime": 0, | |
"Replica": false | |
} | |
} |
This file contains hidden or 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
// ReadConfig reads in a JSON-formatted configuration file, looking for any | |
// include directives, and recursively reading those files as well. Include directives | |
// are specified as a list keyed on the "Includes" key. | |
func ReadConfig(filename string, configuration interface{}) error { | |
// grab any path to the config file to add to the include names | |
var prefix string | |
slashindex := strings.LastIndex(filename, "/") | |
if slashindex != -1 { | |
prefix = filename[:slashindex+1] |
This file contains hidden or 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
package testpage | |
/* | |
This is a thought experiment about a new Go-based UI framework. A project to accomplish the same thing as React or Vue.js. | |
I strongly dislike Javascript and all the existing reactive UI frameworks. For whatever reason, and try as I might, I cannot get my head around | |
them. Hence this thought experiment about what kind of UI framework I would like to use. | |
== Goals == | |
- I want to be able to build a responsive website easily. |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"os" | |
"os/signal" | |
"github.com/Shopify/sarama" | |
) |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"sync" | |
"github.com/Shopify/sarama" |
NewerOlder