This file contains 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
// src/schema_types.rs | |
#[derive(Debug, Clone)] | |
pub enum AuthorFieldType { | |
// Text types | |
String { max_length: Option<usize> }, | |
Text { rows: Option<usize> }, | |
BlockContent, | |
// Number types | |
Number { min: Option<f64>, max: Option<f64> }, |
This file contains 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
<!DOCTYPE html> | |
<!-- this is how you leave comments in .html files --> | |
<html> | |
<head> | |
<title>Hello World</title> | |
</head> <!-- You missed the closing </head> tag. The browser is smart enough to fix this for you but don't forget. --> | |
<body> | |
<h1> wow my head will explode</h1> | |
<hr/> | |
<p> This is my first html code that I have ever done. <br/> I hope you like it</p> |
This file contains 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
use serde_json::{Value}; | |
fn deep_keys(value: &Value, current_path: Vec<String>, output: &mut Vec<Vec<String>>) { | |
if current_path.len() > 0 { | |
output.push(current_path.clone()); | |
} | |
match value { | |
Value::Object(map) => { | |
for (k, v) in map { | |
let mut new_path = current_path.clone(); |
This file contains 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
// hydrate.js | |
function autoHydrate(Component, name) { | |
if (isClient) { | |
return Component; | |
} | |
return props => html` | |
<component-root name=${name} /> | |
<${Component} ...${props} /> | |
<script |
This file contains 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
{ | |
"imports": { | |
"htm": "https://unpkg.com/[email protected]/dist/htm.module.js", | |
"htm/preact": "https://unpkg.com/[email protected]/preact/index.module.js", | |
"preact": "https://unpkg.com/[email protected]/dist/preact.module.js", | |
"preact-render-to-string": "https://unpkg.com/[email protected]/dist/index.module.js" | |
} | |
} |
This file contains 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
// Utils | |
function * typeGenerator (iterable) { | |
yield * iterable; | |
} | |
function * composeGenerator (...iterables) { | |
for (const iterable of iterables) yield * iterable(); | |
} |
This file contains 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
function * type (iterable) { | |
yield * iterable; | |
} | |
const bool = () => type([true, false]); | |
const str = () => type([ | |
'', | |
undefined, | |
'Lorem', | |
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', |
This file contains 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 admin = require("firebase-admin"); | |
const globby = require('globby'); | |
const serviceAccount = require("../../cert.json"); | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), | |
storageBucket: "" // e.g. genesis-morningharwood.appspot.com | |
}); | |
var bucket = admin.storage().bucket(); |
This file contains 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
ng new morningharwood --routing | |
ng generate universal --client-project morningharwood | |
ng generate app-shell --universal-project --route=app-shell-path --client-project=morningharwood | |
ng add @angular/pwa --project morningharwood |
This file contains 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
/* | |
* FROM: | |
*/ | |
@Component({ | |
selector: 'some-other-component' | |
}) | |
export class SomeOtherComponent { | |
private _el: any; |
NewerOlder