Skip to content

Instantly share code, notes, and snippets.

use crate::search::search_service::{SearchService, SearchErr, SearchResponse};
use dioxus::{prelude::*};
use log::debug;
// Render this in another page.
//
// I think of this as a "default layout" component, since you can still use InitFormAndDisplay to do you own layout.
pub fn DefaultComponent(cx: Scope) -> Element {
let (form, display) = InitFormAndDisplay(cx);
// My component which I render.
pub fn Component(cx: Scope) -> Element {
let (form, display) = InitFormAndDisplay(cx);
cx.render(rsx!{
form
div { hr {} }
display
})
}
# ...
# Create a central repo that knows about the dependencies needed from
# requirements_lock.txt.
pip_parse(
name = "pip_deps",
python_interpreter_target = interpreter,
requirements_lock = "//path/to:requirements_lock.txt",
)
RUST_BACKTRACE=1 cargo run --example gzip
Compiling reqwest v0.1.0 (file:///Users/jasonschein/Code/rust/reqwest)
warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
--> examples/gzip.rs:12:9
|
12 | let mut client = reqwest::Client::new().unwrap();
| ^^^^^^^^^^
warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
--> examples/gzip.rs:14:9
@echochamber
echochamber / gtk.css
Created October 24, 2016 16:39
Make Ubuntu GNOME Terminal Have A More Noticable "Active Tab"
/* ~/.config/gtk-3.0/gtk.css */
TerminalWindow .notebook tab:active {
background-color: #F6BBA6;
}
extern crate piston_window;
extern crate graphics;
extern crate piston;
use piston_window::*;
fn main() {
let opengl = OpenGL::V3_2;
let (width, height) = (800, 800);
#!/bin/sh
[[ -e ~/.dotfiles ]] || git clone git@github.com:sonots/.dotfiles.git ~/.dotfiles
pushd ~/.dotfiles
git submodule init
git submodule update
for i in `ls -a`
do
[ $i = "." ] && continue
@echochamber
echochamber / .bash_profile
Last active August 29, 2015 14:05
Dotfiles
export PATH="$(brew --prefix php55)/bin:$PATH"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
function color_my_prompt {
local __default_color="\[\033[37m\]"
local __text_color="\[\033[0;37m\]"
@echochamber
echochamber / InstallVundle.sh
Last active August 29, 2015 14:03
Vimrc and Bashrc
mkdir ~/.vim/
mkdir ~/.vim/swap/
mkdir ~/.vim/backup
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
@echochamber
echochamber / mac_PS1.sh
Last active August 29, 2015 14:03
Cool Bash Stuff
function color_my_prompt {
local __default_color="\[\033[37m\]"
local __text_color="\[\033[0;37m\]"
local __user_and_host="\[\033[0;32m\]\u @ \h$__default_color"
local __cur_location="\[\033[0;36m\]\w$__default_color"
local __git_branch_color="\[\033[1;31m\]"
git --version 2>&1 >/dev/null # improvement by tripleee
GIT_IS_AVAILABLE=$?
if [ $GIT_IS_AVAILABLE -eq 0 ]; then
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\\\\\1\/`'