This file contains 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++ header guard": { | |
"prefix": "guard", | |
"description": "A C++ header include guard from uppercased file's relative path", | |
"body": [ | |
"#ifndef __${1:${RELATIVE_FILEPATH/([\\/.-])|(.)/${1:+_}${2:/upcase}/g}}__", | |
"#define __${1}__", | |
"", | |
"$0", | |
"", |
This file contains 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
//------------------------------------------------ | |
//--- 010 Editor v13.0.2 Binary Template | |
// | |
// File: /System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat | |
// Authors: vit9696, frkd_dev | |
// Version: 0.2 | |
// Purpose: Keyboard layout decoding (replacement of USBKeyboardLayouts.plist) | |
// Category: Operating System | |
// File Mask: *.dat | |
// ID Bytes: 02 EF CD AB |
This file contains 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
/* | |
Tiny emmet implementation. | |
Cleaned and improved fork of: github.com/valleykid/zen-coding | |
Supports: | |
">" - childs, "*" - multiplications, "+" - siblings, "()" - grouping, custom attributes, tag names, "#" - id, "." - class attributes | |
Usage: let html = emm('div#page>header.hd+(section.sc>div.main-wrap>span*3)+footer.ft>div.a'); | |
*/ |
This file contains 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 <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <time.h> | |
#include <sys/time.h> | |
/* | |
Build: | |
gcc -o time_perf time_perf.c |
This file contains 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
// g++ -std=c++11 -O2 -o cache_test cache_test.cpp | |
#include <iostream> | |
#include <time.h> | |
#include <sys/mman.h> | |
#define KB * 1024 | |
#define MB KB KB | |
const size_t memory_size = 32 MB; // memory size allocated for test |
This file contains 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
// https://www.mail-archive.com/directfb-users@directfb.org/msg05080.html | |
//.------------------------------------------. | |
//| DirectFB - Hardware accelerated graphics | | |
//| http://www.directfb.org/ | | |
//"------------------------------------------" | |
#include "config.h" | |
#include <unistd.h> | |
#include <stdio.h> |
This file contains 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
#!/bin/bash | |
# Get system to updated state and install required packages | |
sudo apt update | |
sudo apt full-upgrade | |
sudo apt install clang make libdb-dev libgcrypt20-dev libavahi-client-dev libpam0g-dev | |
# Build and install | |
./configure --with-init-style=systemd --disable-static | |
make -j $(grep -c ^processor /proc/cpuinfo) |
This file contains 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
void uintToCStr(unsigned int val, char* c) | |
{ | |
static const char digitPairs[201] = { | |
"00010203040506070809" | |
"10111213141516171819" | |
"20212223242526272829" | |
"30313233343536373839" | |
"40414243444546474849" | |
"50515253545556575859" | |
"60616263646566676869" |