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
#!/usr/bin/env bash | |
IN_PIPE=$1; | |
_hex() { | |
typeset num=`echo 'obase=16; ibase=10; '"$1" | bc` | |
if ((${#num} == 1)); then | |
num=0"$num" | |
fi |
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
// | |
// color.dart | |
// foundation | |
// | |
// Author: Wess Cope ([email protected]) | |
// Created: 09/16/2021 | |
// | |
// Copywrite (c) 2021 Wess.io | |
// |
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
import 'dart:convert'; | |
class Meta { | |
Map<String, dynamic> _backing; | |
dynamic get(String key) => _backing[key]; | |
void insert(Map<String, dynamic> data) => _backing = {..._backing, ...data}; | |
Meta set(String key, dynamic value) { | |
_backing[key] = value; |
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
import 'package:bastion/providers/data.dart'; | |
import 'package:fluentui_system_icons/fluentui_system_icons.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:hive/hive.dart'; | |
import 'package:window_size/window_size.dart'; | |
enum NavOption { | |
converter, | |
profiles, |
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
class FlutterChannel { | |
static private let _instance = FlutterChannel() | |
private let channel = { | |
let _channel = FlutterMethodChannel(...) | |
channel.setMethodCallhandler(FlutterChannel.route) | |
return _channel | |
}() | |
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
def handle_call({:put, key, value}, _from, state) do | |
{:reply, :ok, Map.put(state, key, value)} | |
end | |
def handle_call({:get, key, value}, _from, state) do | |
{:reply, :ok, Map.get(state, key, value)} | |
end |
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] | |
name = "layerkeep-api" | |
version = "0.0.1" | |
authors = ["wess <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
tide = "0.15.0" | |
tera = "1.5.0" | |
tide-tera = "0.2.2" |
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
use serde::{Serialize}; | |
use mongodb::bson::{ | |
to_bson, | |
Bson, | |
}; | |
pub trait Model : Serialize { | |
fn to_bson(&self) -> Bson { | |
to_bson(self).unwrap() |
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
pub fn auth_request<'a>() -> AuthorizationRequest<'a> { | |
let config = Config::env(); | |
let scopes:Vec<String> = config.github.scope; | |
let request = | |
client() | |
.authorize_url(CsrfToken::new_random); | |
for scope in scopes.iter() { | |
request.add_scope( |
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
let hex_string = match hex.len() { | |
3 => format!( | |
"{}{}{}{}{}{}", | |
&hex[..1], | |
&hex[..1], | |
&hex[1..2], | |
&hex[1..2], | |
&hex[2..3], | |
&hex[2..3] | |
), |