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 std::convert::Infallible; | |
use axum::{ | |
async_trait, | |
extract::FromRequestParts, | |
http::{request::Parts, Request, header::CONTENT_LENGTH}, | |
middleware::{from_fn, Next}, | |
response::{Html, IntoResponse, IntoResponseParts, Response}, | |
routing::get, | |
Router, body::{Full, self}, |
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
error[E0308]: mismatched types | |
--> src/main.rs:5:57 | |
| | |
5 | let _: Router = Router::with_state(true).route("/", get(|_: State<String>| async {})); | |
| ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `String` | |
| | | |
| arguments to this function are incorrect | |
| | |
= note: expected struct `MethodRouter<bool, _>` | |
found struct `MethodRouter<String, _>` |
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 axum::{ | |
extract::{Extension, Path}, | |
routing::get, | |
AddExtensionLayer, Router, | |
}; | |
use hyper::service::make_service_fn; | |
use std::{ | |
convert::Infallible, | |
sync::{Arc, Mutex}, | |
}; |
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 seed::{prelude::*, *}; | |
pub struct Model { | |
url: Url, | |
} | |
pub enum Msg { | |
UrlChanged(Url), | |
} |
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
{ | |
"data": { | |
"setPlayerArchetype": { | |
"success": true | |
} | |
} | |
} |
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
(() => { | |
let Store = { | |
set:(key, object) => { | |
var json = JSON.stringify(object); | |
localStorage.setItem(key, json); | |
}, | |
get: (key) => { | |
var json = localStorage.getItem(key); | |
return JSON.parse(json); |
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
cargo test -j 1 | |
Finished dev [unoptimized + debuginfo] target(s) in 0.24s | |
Running target/debug/deps/graphql_api-fd1595672b534a18 | |
running 31 tests | |
test auth::test::test_bearer_pattern ... ok | |
test cli::run_query::test::test_parsing_operation_name_from_query_with_vars ... ok | |
test cli::run_query::test::test_parsing_operation_name_from_query ... ok | |
test cli::run_query::test::test_parsing_valid_url ... ok | |
test models::factories::test::position_factory ... ok |
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
pub struct CollisionSystem; | |
impl<'a> System<'a> for CollisionSystem { | |
type SystemData = ( | |
Entities<'a>, | |
WriteStorage<'a, Position>, | |
ReadStorage<'a, Velocity>, | |
WriteStorage<'a, Collision>, | |
); |
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
#!/usr/bin/env ruby | |
require "oga" | |
require "rest-client" | |
require "attr_extras" | |
require "colorize" | |
require "active_support/core_ext/string" | |
class String | |
def print(out = STDOUT) |
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
class QueryTracer | |
def disallow_queries | |
return yield unless Rails.env.test? | |
ActiveSupport::Notifications.unsubscribe("sql.active_record") | |
subscriber = ActiveSupport::Notifications.subscribe( | |
"sql.active_record" | |
) do |_name, _start, _finish, _id, payload| | |
if payload[:sql].match?(/select/i) && !payload[:sql].include?("pg_") |
NewerOlder