Skip to content

Instantly share code, notes, and snippets.

View RReverser's full-sized avatar
🇺🇦

Ingvar Stepanyan RReverser

🇺🇦
View GitHub Profile
@RReverser
RReverser / ClangWarnGlobals.cpp
Last active November 2, 2022 01:51 — forked from shardest/.gitignore
Clang plugin by John Bartholomew for finding globals and non-const static variables, unpacked
// -Wglobals Clang plugin
//
// Based on example plugins and searching Clang's API documentation.
// BEWARE! This is my first ever attempt at a Clang plugin.
//
// Written by John Bartholomew <jpa.bartholomew@gmail.com>
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
@RReverser
RReverser / bad-promises.js
Last active December 25, 2016 14:50 — forked from threepointone/bad-promises.js
for ingvar
// consider the following code
// a.js
class A extends Component {
static B = undefined;
state = { B : A.B };
componentWillMount() {
A.B || import('./b.js').then(B => {
@RReverser
RReverser / usb.ts
Last active February 16, 2016 22:07
declare module chrome.usb {
type Direction = 'in' | 'out';
interface Device {
device: number,
vendorId: number,
productId: number,
productName: string,
manufacturerName: string,
serialNumber: string
function Template(str, data) {
return str.replace(/\${([^}]+)}/g, (_, name) => data[name]);
}
var answer = 42;
(function () {
var answer = 60;
console.log(Template('Answer is ${answer}', {answer}));
})();