Skip to content

Instantly share code, notes, and snippets.

View nikhedonia's full-sized avatar
💭
actively open-sourcing

Gaetano Checinski nikhedonia

💭
actively open-sourcing
View GitHub Profile
def merge_dicts(x, y):
z = x.copy()
z.update(y)
return z
cxx_library(
name = "apps",
header_namespace= '',
compiler_flags = ["-fPIC","-m64"],
include_defs('//BUCKAROO_DEPS')
def test_tree(name, path):
genrule(
name = name,
out = ".",
srcs = [path],
cmd = "cp -r $SRCS/* $OUT"
)
return ":"+name
load('//:BUCKAROO_DEPS', 'deps')
load('@boost.helpers//:DEFS', 'test_tree', 'sh_cxx_test')
cxx_library(
name = "test",
exported_headers = subdir_glob([
("include", "**/*.hpp"),
("include", "**/*.ipp"),
]),
exported_linker_flags=['-lpthread'],
def test_tree(name, path):
genrule(
name = name,
out = ".",
srcs = [path],
cmd = "cp -r $SRCS/* $OUT"
)
return ":"+name
prebuilt_cxx_library(
name = 'json',
header_namespace = 'nlohmann',
header_only = True,
exported_headers = subdir_glob([
('src', '*.hpp')
]),
visibility = [
'PUBLIC',
]
@nikhedonia
nikhedonia / request_over_tor.js
Created December 28, 2017 16:16
sending a request over tor and renew ip
var Https = require('socks5-https-client/lib/Agent');
var Http = require('socks5-http-client/lib/Agent');
var openports = require('openports');
var net = require('net');
var tmp = require('tmp');
var request = require('request');
const { spawn } = require('child_process');
function spawnTor(port, port2) {
const tmpobj = tmp.dirSync();
@nikhedonia
nikhedonia / hello.html
Last active June 27, 2017 14:56
WasmHelloWorld
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Emscripten-Generated Code</title>
<style>
body {
font-family: arial;
margin: 0;
#define CREATE_VECTOR(D) \
struct Vector_##D {\
static constexpr int N = D;\
int data[N];\
\
Vector_##D (Vector_##D const& v) {\
for(int i=0; i<N ; ++i) {\
data[i] = v[i];\
}\
template<int D>
struct Vector {
static constexpr unsigned N = D;
int data[N];
Vector (Vector<D> const& v) {
for(int i=0; i<N ; ++i) {
data[i] = v[i];
}
}
struct Texture {
  Texture(string const& path) { cout << "Texture loaded from " << path << endl; }
 ~Texture() { cout<< "Texture destroyed" << endl; }
 
  static shared_ptr<Texture> load(string const& path) {
  return make_shared<Texture>(path)
  }
};
// this functions will take a copy and increment the counter