Skip to content

Instantly share code, notes, and snippets.

View Elliott-Hu's full-sized avatar

Hu Zehan Elliott-Hu

  • Shenzhen,Guangdong China
View GitHub Profile
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@stephanbogner
stephanbogner / index.html
Created June 25, 2018 20:36
Native like pinch and zoom of div with HammerJs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HammerJS Pinch Zoom and Drag</title>
<style type="text/css">
body{
margin: 0;