Skip to content

Instantly share code, notes, and snippets.

View buzzySmile's full-sized avatar

Alexander Makarov buzzySmile

  • Bishkek City, Kyrgyzstan
View GitHub Profile
@buzzySmile
buzzySmile / qba_cutter.hpp
Last active August 29, 2015 13:57
QByteArray Chunk Cutter
#include <QByteArray>
/// Extension of class QByteArray:
/// allows cut off a chunk from begining of byte array
/// chunk is equivalent quint8, quint16 or quint32 by length
class qBA_cutter: public QByteArray
{
private:
union {
quint16 sshort;
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS__) || defined(__TOS_WIN__)
#include <windows.h>
#include <stdint.h>
#define GET_METHOD GetProcAddress
#define OPEN_LIBRARY(X) LoadLibrary((LPCSTR)X)
#define LIBRARY_POINTER_TYPE HMODULE
#define CLOSE_LIBRARY FreeLibrary
#else
#include <dlfcn.h>
#include <unistd.h>
@buzzySmile
buzzySmile / QBlinkLabelControl.cpp
Created September 23, 2014 07:41
This class supports QLabel blinking with fading effect
#include "QBlinkLabelControl.h"
QBlinkLabelControl::QBlinkLabelControl(QLabel *label, int _fade_time, int _fade_factor) :
m_Label(label),
m_iTime(_fade_time),
m_iFade(_fade_factor)
{
this->setMinimumWidth(70);
m_BackgroundColor = QColor(Qt::black);
@buzzySmile
buzzySmile / QFsmDataParser.cpp
Created September 23, 2014 07:55
Final-State-Mashine-based data parser. Data message(QByteArray) has to have token, body and checksum.
#include "QFsmDataParser.h"
QFsmDataParser::QFsmDataParser(const QByteArray &token, int _size):
m_Token(token),
m_iSize(_size)
{
reset();
}
QFsmDataParser::~QFsmDataParser()
@buzzySmile
buzzySmile / proto_compile.pri
Created February 5, 2015 11:02
Qt qmake integration with Google Protocol Buffers compiler protoc
# Qt qmake integration with Google Protocol Buffers compiler protoc
#
# To compile protocol buffers with qt qmake, specify PROTOS variable and
# include this file
#
# Example:
# BITSIZE = $$system(getconf LONG_BIT)
# if (contains(BITSIZE, 64)) {
# LIBS += /usr/lib/x86_64-linux-gnu/libprotobuf.so
# }
@buzzySmile
buzzySmile / packagesymbols.py
Created June 24, 2016 12:28 — forked from luser/packagesymbols.py
Scripts to produce symbol package and upload to Mozilla crash-stats server
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import zipfile
@buzzySmile
buzzySmile / license-badges.md
Created October 31, 2016 21:09 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Want to add a License?

Comment this gist or write me an E-Mail ([email protected])

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@buzzySmile
buzzySmile / docker-cleanup
Created March 2, 2018 13:42 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@buzzySmile
buzzySmile / Xiaomi YI.md
Created March 4, 2018 19:44 — forked from franga2000/Xiaomi YI.md
Xiaomi Yi

#Xiaomi Yi camera

##General info

  • OS: Buildroot
  • CPU: ARMv6-compatible processor rev 5 (v6l)
  • BogoMIPS: 524.28
  • Memory: 37MB

The root filesystem is rootfs, which is stored in memory and therefore wiped on reboot. The Micro SD card is mounted at /tmp/fuse_d/. Something is also mounted at /tmp/fuse_a and /tmp/fuse_z.