Skip to content

Instantly share code, notes, and snippets.

View letiantian's full-sized avatar
💭
I may be slow to respond.

乐天 letiantian

💭
I may be slow to respond.
View GitHub Profile
@letiantian
letiantian / dabblet.css
Last active November 18, 2015 02:37
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
@letiantian
letiantian / trim.cpp
Last active February 2, 2025 14:57
trim string in C++ 11
#include <iostream>
std::string trim(const std::string & source) {
std::string s(source);
s.erase(0,s.find_first_not_of(" \n\r\t"));
s.erase(s.find_last_not_of(" \n\r\t")+1);
return s;
}
int main(int argc, const char * argv[]) {