Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
When am I not writing code?

Wess Cope wess

💭
When am I not writing code?
View GitHub Profile
View Onboarding.dart
class OnboardingScreen extends StatefulWidget {
const OnboardingScreen({Key? key}) : super(key: key);
@override
_OnboardingScreenState createState() => _OnboardingScreenState();
}
class _OnboardingScreenState extends State<OnboardingScreen> {
final TextEditingController _nameController = TextEditingController();
View monitor.sh
#!/usr/bin/env bash
export SODA_SCRIPTS_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source ${SODA_SCRIPTS_ROOT}/__echo.sh
#### Websocket Setup
SERVER_PORT=3333
WS_PIPE=/tmp/_websocket.tmp
IN_PIPE=/tmp/_in_websocket.tmp
@wess
wess / websocket_server.sh
Created Nov 10, 2021
Websocket Server in Bash [poc]
View websocket_server.sh
#!/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
View color_ext.dart
//
// color.dart
// foundation
//
// Author: Wess Cope (me@wess.io)
// Created: 09/16/2021
//
// Copywrite (c) 2021 Wess.io
//
View meta.dart
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;
View provider.dart
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,
@wess
wess / FlutterChannel.swift
Last active Jun 4, 2021
FlutterChannel.swift
View FlutterChannel.swift
class FlutterChannel {
static private let _instance = FlutterChannel()
private let channel = {
let _channel = FlutterMethodChannel(...)
channel.setMethodCallhandler(FlutterChannel.route)
return _channel
}()
View gist:917d0142b3c6079abb82327d251a71c7
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
View Cargo.toml
[package]
name = "layerkeep-api"
version = "0.0.1"
authors = ["wess <me@wess.io>"]
edition = "2018"
[dependencies]
tide = "0.15.0"
tera = "1.5.0"
tide-tera = "0.2.2"
@wess
wess / model.rs
Created Nov 12, 2020
Feed backs, please
View model.rs
use serde::{Serialize};
use mongodb::bson::{
to_bson,
Bson,
};
pub trait Model : Serialize {
fn to_bson(&self) -> Bson {
to_bson(self).unwrap()