Skip to content

Instantly share code, notes, and snippets.

@atomass
atomass / JSONHelper.h
Last active May 25, 2018 14:41
Serialize QObject derived class into QJsonDocument
#ifndef JSONHELPER_H
#define JSONHELPER_H
#include <QJsonObject>
#include <QMetaProperty>
class JSONHelper
{
public:
template<class T>
@random-robbie
random-robbie / install_go_pi.sh
Created April 26, 2018 14:16
Install Go Lang 1.10.1 on Raspberry Pi 3
wget https://storage.googleapis.com/golang/go1.10.1.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.10.1.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@kurtis318
kurtis318 / Linux_VNC_crashed_immediately_in_Remmina.txt
Created January 19, 2018 22:02
Linux VNC crashed immediately in Remmina
I have been using Remmina on Linux for a number of years. I experienced Linux VNC session starting and then crashing immediately for a number of years. I finally decided to figure it out. A quick Google showd the following issue in Github FreeRDP:
https://github.com/FreeRDP/Remmina/issues/699
Title: VNC window immediately closes after connection attempt
Turns out crashing is happens when I run High color 15bbp (color depth) and a Linux Mint 18.3 KVM on Fedora had Cirrius video with VNC server.
When I set color depth High color (24 bbp) no more crashing.
Wonder if this will fix periodic crashes during other X-Window events which I cannot re-create on demand.
@jerome-pouiller
jerome-pouiller / cross-compile-ldd
Last active May 23, 2024 19:35
ldd drop-in replacement for cross-compilation toolchains.
#!/bin/bash
# ldd drop-in replacement for cross-compilation toolchains.
# This file is a slightly modified version of xldd.in from
# crosstool-ng 1.22.0
# In order to use it, copy it in same directory than other
# toolchain binaries and rename it with same tuple.
# (i.e. /opt/arm-sysmic-linux-gnueabihf/bin/arm-sysmic-linux-gnueabihf-ldd)
@lucijafrkovic
lucijafrkovic / git_retag
Created April 28, 2016 14:02
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d V_1_0_1
3. push tag deletion to remote
git push origin :refs/tags/V_1_0_1
4. tag local branch again
@C5H8NNaO4
C5H8NNaO4 / whatsapp-web-online-notifier.js
Last active August 10, 2023 23:30
WhatsApp Web - Displays Desktop Notifications when a user gets online [console]
(function (window) {
var DOUBLE_CLICK_DELAY = 550;
var OnlineNotifier = (function () {
var LOG_LEVEL = 01;
var POLL_TIMEOUT = 1E3;
var MIN_TIMEOUT = 60E3;
var MIN_TIMEOUT_TYPING = 5E3
var DEBUG_CHECK_ALL = false;
var DEBUG_CHECK_ONLINE = false;
var DEBUG_CHECK_TYPING = false;
@lopspower
lopspower / README.md
Last active July 24, 2024 11:39
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@bencord0
bencord0 / system_uuid.sh
Last active August 31, 2023 11:51
Unique id for a linux system
#!/bin/bash
cat /var/lib/dbus/machine-id && exit
# Provided by dbus, hence available on all systemd systems.
# Any user can read it and it is persistent accross boots.
# It is unique per installation, and works well in VMs.
# Not all systems (i.e. stage3 gentoo/handbook install)
# have dbus installed by default.
cat /sys/class/dmi/id/product_uuid && exit
@umidjons
umidjons / index.html
Last active January 6, 2024 18:46
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>