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
import functools | |
def wrap(wrapped): | |
@functools.wraps(wrapped) | |
def wrapper(*args, **kwds): | |
print("%s(%s)" % (wrapped.__name__, ", ".join(["%r" % i for i in args] + ["%s=%r" % i for i in kwds.items()]))) | |
try: | |
ret = wrapped(*args, **kwds) | |
except BaseException as err: | |
print("%s >> %r" % (wrapped.__name__, err)) |
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
stat -f '%d %i %Sp %l %Su %Sg %r %z "%Sa" "%Sm" "%Sc" "%SB" %k %b %#Xf %N' |
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
C:\cygwin64\bin\mintty /bin/wslbridge -C ~ |
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 findString(object, string, seen, path) { | |
seen = seen || [object]; | |
path = path || ""; | |
for (var i in object) { | |
try { object[i]; } catch (e) { continue; } | |
if (!seen.includes(object[i])) { | |
seen.push(object[i]); | |
if (object[i] instanceof Object && !(object[i] instanceof HTMLElement)) | |
findString(object[i], string, seen, path + '["' + i + '"]'); | |
else if (typeof object[i] === "string" && object[i].includes(string)) |
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
import java.util.EnumSet; | |
import java.util.Set; | |
import java.util.stream.Collector; | |
public interface CollectorIdentityObject<T, A, R> extends CollectorObject<T, A, R> { | |
@Override | |
@SuppressWarnings("unchecked") | |
default R finish(A a) { | |
return (R) a; | |
} |
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 <iostream> | |
class Test { | |
public: | |
Test() { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
Test(Test const&) { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
Test(Test&&) { std::cout << __PRETTY_FUNCTION__ << std::endl; } | |
~Test() { std::cout << __PRETTY_FUNCTION__ << std::endl; } |
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 <cxxabi.h> | |
#include <typeinfo> | |
#include <type_traits> | |
#include <string> | |
#include <memory> | |
#include <cstdlib> | |
template<typename T> | |
std::string type_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
#include <utility> | |
template<typename F, typename... Args> | |
decltype(auto) call(F&& f, Args&&... args) { return f(std::forward<Args>(args)...); } |
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
VecResult.prototype.toSVG = function() { | |
let paths = []; | |
this.pieces.forEach(piece => { | |
let index = 0; | |
piece.shapes.forEach(shape => { | |
let commands = []; | |
shape.lenghts.forEach(length => { |
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
((prototype, CONNECTING, OPEN, CLOSING, CLOSED) => { | |
WebSocket = function() { | |
const ws = new prototype.constructor(...arguments); | |
console.trace("new WebSocket", arguments, "=>", ws); | |
ws.addEventListener("message", event => console.log(event.data)); | |
return ws; | |
}; | |
WebSocket.prototype = prototype; | |
WebSocket.CONNECTING = CONNECTING; | |
WebSocket.OPEN = OPEN; |
OlderNewer