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
(defun find-url-at-point (&optional url) | |
"Open the URL at point." | |
(interactive) | |
(switch-to-buffer | |
(url-retrieve-synchronously | |
(or url (let ((default-search-string (if (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end)) (thing-at-point-url-at-point) ))) | |
(read-string (format "URL: %s" (or default-search-string "")) nil nil default-search-string) ) )) )) |
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 <regex> | |
#include <string> | |
#include <vector> | |
std::vector<std::string> Split(const std::string& str, const std::string& regex) | |
{ | |
return {std::sregex_token_iterator(str.begin(), str.end(), std::regex(regex), -1), std::sregex_token_iterator()}; | |
} |
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
// C++11 32bit FNV-1 and FNV-1a string hasing (Fowler–Noll–Vo hash) | |
// | |
// Requires a compiler with C++11 support | |
// See main(...) for examples | |
#include <iostream> | |
#include <cassert> | |
namespace hash | |
{ |