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 inspect | |
import ast | |
def d(*values): | |
f = inspect.currentframe() | |
f_name = f.f_code.co_name | |
caller_ast = ast.parse(inspect.getsource(f.f_back)) | |
def find_names(root): | |
for child in ast.iter_child_nodes(root): |
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
// a.hpp | |
class A { | |
virtual void do() = 0; | |
} | |
// b.hpp | |
#include "a.hpp" | |
class B: public A { | |
void do_something_else(); | |
} |
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
from collections import defaultdict | |
events = [ | |
('a', 0), | |
('b', 1), | |
('a', 2), | |
('b', 2), | |
('b', 3), | |
('a', 3) | |
] |
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
static float decode_float(const uint8_t *data) { | |
float f; | |
uint8_t bytes[] = {data[3], data[2], data[1], data[0]}; | |
memcpy(&f, bytes, 4); | |
return f; | |
} |
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
jdiez@WarpPrism ~/dev/sway/sway/build master cmake .. | |
CMake Warning (dev) at CMakeLists.txt:33 (add_definitions): | |
Policy CMP0005 is not set: Preprocessor definition values are now escaped | |
automatically. Run "cmake --help-policy CMP0005" for policy details. Use | |
the cmake_policy command to set the policy and suppress this warning. | |
This warning is for project developers. Use -Wno-dev to suppress it. | |
CMake Error at CMakeLists.txt:64 (add_manpage): | |
Unknown CMake command "add_manpage". |
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
coreos: | |
units: | |
- name: 00-eth1.network | |
runtime: yes | |
content: | | |
[Match] | |
Name=eth1 | |
[Network] | |
DHCP=ipv4 |
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: service.yaml | |
with_items: | |
- elasticsearch | |
- logstash | |
- kibana | |
- mongo | |
- postgres |
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
ok: [kylink-dev] => { | |
"service": { | |
"changed": false, | |
"msg": "All items completed", | |
"results": [ | |
{ | |
"_ansible_no_log": false, | |
"_ansible_notify": [ | |
"reload systemd" | |
], |
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
jdiez@Hobgoblin:~/dev/ops/infrastructure/ansible$ ansible-playbook -i inventory/all bootstrap.yml --limit kylink-dev | |
PLAY [Install basic services] ************************************************** | |
TASK [setup] ******************************************************************* | |
ok: [kylink-dev] | |
TASK [common : Install services] *********************************************** | |
ok: [kylink-dev] => (item=elasticsearch) | |
ok: [kylink-dev] => (item=logstash) | |
ok: [kylink-dev] => (item=kibana) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include "server.h" | |
void client_connect(int fd, const char* host, const char* port) { | |
printf("New connection from %s:%s on fd %d\n", host, port, fd); | |
} | |
void client_disconnect(int fd) { |