Skip to content

Instantly share code, notes, and snippets.

import QtQuick 2.4
Column {
width: parent.width
height: parent.height
property alias model: columnRepeater.model
Repeater {
id: columnRepeater
@JayKickliter
JayKickliter / compdb.mk
Created February 28, 2018 21:26
Generate 'compile_commands.json' in Makefile
%.compdb_entry: %.c
@echo " {" > $@
@echo " \"command\": \"cc $(CFLAGS) $(CPPFLAGS) -c $<\"," >> $@
@echo " \"directory\": \"$(CURDIR)\"," >> $@
@echo " \"file\": \"$<\"" >> $@
@echo " }," >> $@
COMPDB_ENTRIES = $(addsuffix .compdb_entry, $(basename $(SOURCES)))
compile_commands.json: $(COMPDB_ENTRIES)
@jerodg
jerodg / windows_and_office_kms_setup.adoc
Last active May 20, 2024 13:14
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@pavelburov
pavelburov / set_command_output_to_variable.bat
Created January 26, 2018 14:10
windows batch (bat, cmd) - How to set command output to variable
for /f %%i in ('application arg0 arg1') do set VARIABLE=%%i
echo %VARIABLE%
@ChemistAion
ChemistAion / Nodes.cpp
Created January 25, 2018 15:02
Prototype of standalone node graph editor for ImGui
// Prototype of standalone node graph editor for ImGui
// Thread: https://github.com/ocornut/imgui/issues/306
//
// This is based on code by:
// @emoon https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2
// @ocornut https://gist.github.com/ocornut/7e9b3ec566a333d725d4
// @flix01 https://github.com/Flix01/imgui/blob/b248df2df98af13d4b7dbb70c92430afc47a038a/addons/imguinodegrapheditor/imguinodegrapheditor.cpp#L432
#include "Nodes.h"
@AllanZyne
AllanZyne / build_qt.md
Last active December 21, 2020 15:32
Build Qt 5.6 for Windows XP with Qt Webkit (VS 2017)

编译 Qt 5.6.3 Windows XP with Qt Webkit (VS 2017)

准备工具

  • qt 5.6.3 的源码
  • qt webkit 的源码(从 github 上下载 5.6 分支,保存到 qt 源码的目录中)
  • python27
  • ruby24
Basic
=====
[Shift]+[Mod]+[Enter] - launch terminal.
[Mod]+[b] - show/hide bar.
[Mod]+[p] - dmenu for running programs like the x-www-browser.
[Mod]+[Enter] - push acive window from stack to master, or pulls last used window from stack onto master.
[Mod] + [j / k] - focus on next/previous window in current tag.
@danieloneill
danieloneill / OtherComponent.qml
Created November 22, 2017 07:41
Qml Reloading technique
import QtQuick 2.7
Item {
Loader {
id: multilevelLoader
anchors.fill: parent
property string sourceUrl: 'ThirdComponent.qml'
function reload()
{
source = sourceUrl + '?' + loader.counter;
@meskarune
meskarune / vimrc
Last active November 3, 2023 07:58
simple functional vim status line - jellybeans theme colors
" status bar colors
au InsertEnter * hi statusline guifg=black guibg=#d7afff ctermfg=black ctermbg=magenta
au InsertLeave * hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
" Status line
" default: set statusline=%f\ %h%w%m%r\ %=%(%l,%c%V\ %=\ %P%)
" Status Line Custom
let g:currentmode={
@ronshapiro
ronshapiro / dagger-android-view.md
Last active April 24, 2024 00:19
dagger.android for views in ~10 minutes

1. You can implement View.getActivity() like this:

public interface ViewWithActivity {
  // Using android-gradle-plugin 3.0, which has the desugar step for default methods on interfaces
  default Activity getActivity() {
    // https://android.googlesource.com/platform/frameworks/support/+/03e0f3daf3c97ee95cd78b2f07bc9c1be05d43db/v7/mediarouter/src/android/support/v7/app/MediaRouteButton.java#276
    Context context = getContext();
    while (context instanceof ContextWrapper) {
      if (context instanceof Activity) {