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
Animated Button | |
Go | |
click -> Loading | |
Loading | |
successful -> Success | |
failure -> Error | |
Success | |
reset -> Go | |
Error | |
reset -> Go |
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
Aspiration App Logic | |
open app from home screen -> Has User Previously Logged In? | |
Logged Out Flow | |
Has User Previously Logged In? | |
yes -> Is Device Authentication Set Up? | |
no -> App Welcome Screen | |
App Welcome Screen | |
tap login -> Is Device Authentication Set Up? |
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
// an example to create a new mapping `ctrl-y` | |
/* | |
mapkey('<Ctrl-y>', 'Show me the money', function() { | |
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
}); | |
*/ | |
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works. | |
map('?', 'u'); |
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
// My settings: | |
if (window.location.origin === "https://www.duckduckgo.com") { | |
unmap('h'); | |
unmap('j'); | |
unmap('k'); | |
unmap('l'); | |
} |
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
#[derive(Debug)] | |
struct I(i32); | |
macro_rules! p { | |
($e:expr) => (println!("{:30}: {:?}", stringify!($e), $e)); | |
} | |
trait PrefixStuff { |
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
#![feature(unboxed_closures)] | |
#![feature(fn_traits)] | |
#[derive(Clone)] | |
struct Foo (i32); | |
type Bar = i32; | |
impl Foo { | |
fn go(&self, _: &i32) { } |
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
#![feature(unboxed_closures)] | |
#![feature(fn_traits)] | |
#[derive(Clone)] | |
struct Pr { | |
pat: i32 //, mat: Matcher<'a,'a> | |
} | |
type MState = i32; |
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
//#![feature(question_mark)] | |
use std::ops::Deref; | |
use std::ops::DerefMut; | |
#[derive(Debug, Default)] | |
struct ReuseBuf { | |
inner: Vec<u32>, | |
used: bool | |
} |
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
macro_rules! defer { | |
($x:expr) => { | |
let _x = { | |
struct Deferred<F: Fn()>(F); | |
impl<F: Fn()> Drop for Deferred<F> { | |
fn drop(&mut self) { | |
self.0(); | |
} | |
} |
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
#![allow(dead_code)] | |
#![allow(unused_variables)] | |
#![allow(unused_mut)] | |
struct Asdf(i32, Option<Gc<Asdf>>); | |
struct Gc<T>(*const T); | |
impl<T> Drop for Gc<T> { | |
fn drop(&mut self) { |
NewerOlder