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
struct URL | |
{ | |
std::string Schema; | |
std::string User; | |
std::string Pass; | |
std::string Host; | |
uint32_t Port; | |
std::string Path; | |
std::string Query; | |
}; |
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
#expr = term + expr | term - expr | term | |
#term = term * factor | term / factor | factor | |
#factor = '(' expr ')' | number | |
# | |
def getch(expr, ch): | |
while expr[0] == ' ': | |
expr = expr[1:] |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#include <stdlib.h> | |
#include <boost/regex.hpp> | |
#include <iostream> | |
int main() | |
{ | |
boost::regex e("(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"); | |
boost::match_results<std::string::const_iterator> what; | |
const std::string str("哈哈哈 8.8.8.8 1.2.3.4 256.256.247.1"); | |
auto first = str.begin(); | |
auto last = str.end(); |
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
Usage: diskutil coreStorage list | |
Usage: diskutil coreStorage info[rmation] [-plist] | |
Usage: diskutil coreStorage convert | |
Usage: diskutil coreStorage revert | |
Usage: diskutil coreStorage create lvgName | |
Usage: diskutil coreStorage delete lvgUUID | |
Usage: diskutil coreStorage addDisk lvgUUID NewMemberDeviceName | |
Usage: diskutil coreStorage removeDisk pvUUID | |
Usage: diskutil coreStorage deleteVolume lvUUID | |
Usage: diskutil coreStorage resizeVolume lvUUID size |
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
package main | |
import ( | |
"time" | |
) | |
/* | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
template<typename Iterator> | |
struct IniGrammar | |
: qi::grammar<Iterator, std::map<std::string, std::string>()> | |
{ | |
IniGrammar() | |
: IniGrammar::base_type(start) | |
{ | |
using ascii::char_; | |
using qi::lexeme; | |
using spirit::skip; |
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
var net = require("net"); | |
var server = net.createServer(function(req) { | |
req.on('data', function(data) { | |
req.write(data); | |
}); | |
}); | |
server.listen(8000); |
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
#include <boost/asio.hpp> | |
namespace asio = boost::asio; | |
using asio::ip::tcp; | |
#include <boost/bind.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/enable_shared_from_this.hpp> | |
class session | |
: public boost::enable_shared_from_this<session> |
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
#include <cstdlib> | |
#include <iostream> | |
#include <boost/bind.hpp> | |
#include <boost/asio.hpp> | |
#include <boost/thread/thread.hpp> | |
#include <boost/shared_ptr.hpp> | |
#include <boost/enable_shared_from_this.hpp> | |
using boost::asio::ip::tcp; |
NewerOlder