Skip to content

Instantly share code, notes, and snippets.

View icecoobe's full-sized avatar
🎯
Focusing

Luke icecoobe

🎯
Focusing
View GitHub Profile
@icecoobe
icecoobe / count_one_bit.cpp
Last active January 4, 2023 11:21
count 1 bits
#include <iostream>
size_t count_one_bit(uint64_t num)
{
size_t count = 0x0;
while (num > 0x0)
{
if ((num & 0x01) != 0)
#include <cstdint>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
using namespace std;
/*window icon*/
QLabel#label_logo{
image: url(:/skin/image/logo.png);
}
/*大标题*/
QLabel#label_title{
font-size:15px;
font-weight:bold;
@icecoobe
icecoobe / nginx-thingsboard
Created March 23, 2022 15:36 — forked from mfalkvidd/nginx-thingsboard
Thingsboard nginx reverse proxy with websocket and HTTPS support (Let's Encrypt)
server {
listen 80;
server_name EXTERNAL_THINGSBOARD_DOMAIN.com;
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
}
server {
@icecoobe
icecoobe / esp8266_pubsubclient.ino
Created December 15, 2021 10:09 — forked from igrr/esp8266_pubsubclient.ino
PubSubClient sample for ESP8266 Arduino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "iot.eclipse.org";
@icecoobe
icecoobe / cseh.c
Created November 23, 2017 06:46
SEH in C
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <assert.h>
static void test(void);
static void test2(void);
jmp_buf exception_handled;
@icecoobe
icecoobe / class_test.cpp
Created November 20, 2017 09:20
cpp class test
#include <iostream>
using namespace std;
class Base {
// int a;
public:
int a;
Base() { a = 0; }
Base(int x) { a = x; }
@icecoobe
icecoobe / checkCPU.c
Created August 23, 2017 07:12
check whether CPU is little-endian
#include <stdio.h>
#include <stdlib.h>
int is_little_endian(void)
{
union w
{
int a;
char b;
} c;
@icecoobe
icecoobe / ExceptionTestForm.cs
Created February 28, 2017 06:18
Exception handling of multiple-threaded model in C#
using System;
using System.Threading;
using System.Windows.Forms;
namespace ET_WinForm
{
public partial class ExceptionTestForm : Form
{
Thread worker = new Thread(Go);
Thread worker2 = new Thread(Back);
@icecoobe
icecoobe / elf.h
Created February 20, 2017 16:15 — forked from mlafeldt/elf.h
elf.h for OSX
/* This is the original elf.h file from the GNU C Library; I only removed
the inclusion of feature.h, which is not needed.
On OSX, simply copy the file to /usr/local/include/.
Mathias Lafeldt <mathias.lafeldt@gmail.com> */
/* This file defines standard ELF types, structures, and macros.
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011
Free Software Foundation, Inc.