Skip to content

Instantly share code, notes, and snippets.

View chinedufn's full-sized avatar

Chinedu Francis Nwafili chinedufn

View GitHub Profile
@chinedufn
chinedufn / webapis.rs
Created July 25, 2018 01:39
web apis error
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
pub type HTMLDocument;
#[wasm_bindgen(js_namespace = console)]
pub fn log(msg: &str);
pub static document: HTMLDocument;
@chinedufn
chinedufn / virtual-dom-input-validation.js
Last active August 29, 2015 14:25
Functional input validation
// Somewhere
[
h('input', {
placeholder: 'card number',
oninput: function (e) {targets.handleCardNumber({number: e.srcElement.value, state: state})
}),
h('span', state.get().cardNumberError)
]
@chinedufn
chinedufn / gist:3669589b4aee52b814b9
Last active August 29, 2015 14:03
Tapping a button to send an email on iOS 7
#import <MessageUI/MFMailComposeViewController.h>
/********** Later... *************/
//link your button up to this
- (void) buttonPressed:(id)(sender){
//if their device can send emails
if([MFMailComposeViewController canSendMail]){