Skip to content

Instantly share code, notes, and snippets.

@a-a
a-a / sad2.c
Created August 1, 2018 10:24
:(
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <windows.h>
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
const char* RESET = "\x1B[0m";
@a-a
a-a / sad.cpp
Created July 31, 2018 10:30
:(
#include "stdafx.h"
#include <stdio.h>
#include <time.h>
#include <chrono>
#include <thread>
#include <Windows.h>
void SetColorAndBackground(int ForgC, int BackC = 0) {
WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
@a-a
a-a / puck.js eddystone-ibeacon-example.js
Created March 4, 2018 18:19
Example code for getting Eddystone, iBeacon, or both advertising on a Puck.JS. Turns on/off with the button, and displays battery level too :)
// Eddystone and iBeacon example code for Puck.js 1.92 or above
// How to use: paste into the web IDE, adjust to your needs, and upload to your puck.
// Setup which type of advertising you wish to make, Eddystone, iBeacon, or both. Uncomment ONLY ONE.
function doAdvertising() {
doEddystone(); //By default, we advertise eddystone only.
//doiBeacon();
//advertiseBoth();
}