This file contains hidden or 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
datetime=$( date +%m%d%H%M%Y ); ssh root@remote_addr "( date $datetime; /sbin/hwclock --systohc )" |
This file contains hidden or 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
In these days of git everywhere, you may forget CMake and use git clean -d -f -x, that will remove all files not under source control. |
This file contains hidden or 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 <cstdio> | |
#include <curl/curl.h> | |
#include <curl/easy.h> | |
#include <string> | |
#include <cassert> | |
#include <stdexcept> | |
#include <sstream> | |
#include <iostream> | |
void download(const std::string& url, const std::string& filename) { |
This file contains hidden or 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
inline std::string formatTime(const time_t t) { | |
std::tm timeinfo = *::gmtime(&t); | |
char buffer[16]; | |
std::strftime(buffer, sizeof(buffer), "%Y%m%d-%H%M%S", &timeinfo); | |
return std::string { buffer }; | |
} | |
template <typename T> | |
inline std::string formatTime(T&& t) { | |
using clock = typename std::remove_reference<T>::type::clock; |
This file contains hidden or 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
function _makeSticky($sticky) { | |
var $parent = $sticky.parent(); | |
var parentOffset = null; | |
var myOffset = null; | |
$(window).bind('scroll', function () { | |
var scroll = $(document.body).scrollTop(); | |
if (myOffset === null) { | |
parentOffset = $parent.offset().top; | |
myOffset = $sticky.position().top; | |
} |
This file contains hidden or 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 T> | |
T pickRandom(std::vector<T>&& vec) { | |
return vec[::rand() % vec.size()]; | |
} | |
template<typename T> | |
T pickRandom(std::initializer_list<T>&& list) { | |
return pickRandom(std::vector<T>(std::move(list))); | |
} |
This file contains hidden or 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
class Bar { | |
template<typename T, typename = typename std::enable_if< !std::is_same<Foo, typename std::decay<T>::type >::value >> | |
inline Bar(T&& v) { } | |
}; |
This file contains hidden or 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 makeLazy = function (fn, delay) { | |
var timeHandler; | |
return function () { | |
clearTimeout(timeHandler); | |
timeHandler = setTimeout(fn.bind.apply(fn, [null].concat(Array.prototype.slice.call(arguments))), delay); | |
}; | |
}; |
This file contains hidden or 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 permanentValue = function (name) { | |
var that = {}; | |
var prefix = 'debug-'; | |
that.store = function (val) { | |
localStorage.setItem(prefix + name, val); | |
return val; | |
}; | |
that.load = function () { | |
return localStorage.getItem(prefix + name); | |
}; |
This file contains hidden or 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
(this.props.onChange || Function)(); |