Skip to content

Instantly share code, notes, and snippets.

spooky / refresh.html
Created Sep 21, 2018
tiny obj to template binder
View refresh.html
<!doctype html>
<html class="no-js" lang="">
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
body {
spooky /
Created Jul 19, 2018
from dataclasses import dataclass, field, asdict
import hug
class Paged:
items: list = field(default_factory=list)
total: int = 0
spooky / Builder.cs
Last active Jul 6, 2018
message builder
View Builder.cs
using System;
using System.Collections.Generic;
namespace MsgBuilder
public partial class Builder<T>
internal class Message : Dictionary<string, T>, IMessage<T>
private Builder<T> _builder;
#! /usr/bin/python
import sys
def generate(count=10):
def msg(key, value):
return '*3\r\n$3\r\nSET\r\n${}\r\n{}\r\n${}\r\n{}\r\n'.format(len(key), key, len(value), value)
for i in range(count):
spooky /
Created Aug 23, 2017
qml crash after close
import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
def run():
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
spooky /
Last active Aug 22, 2017
2 way qml binding
import sys
from PyQt5.QtCore import QObject, QUrl, pyqtSignal, pyqtSlot, pyqtProperty
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
class ViewModel(QObject):
text_changed = pyqtSignal(name='textChanged')
View sublime prefs
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Colorsublime - Themes/Muukii.tmTheme",
"fade_fold_buttons": false,
"fold_buttons": true,
"font_face": "Droid Sans Mono",
"font_size": 12,
"highlight_line": true,
View git shell aliases
alias gs='git st'
alias gd='git diff --ignore-all-space'
alias gl='git l'
View .gitconfig
autosetuprebase = always
ui = auto
st = status
br = branch
#l = log --pretty=tformat:"%C(yellow)%h\\ %ad%Creset\\ |\\ %s%C(cyan)\\ [%an]\\%Cred%d%Creset" --decorate --graph --abbrev-commit --date=relative
hl = log --pretty=tformat:"%C(yellow)%h\\ %Cgreen(%ad)%Creset\\ -\\ %s%C(cyan)\\ [%an]\\%Cred%d%Creset" --decorate --graph --abbrev-commit --date=relative
ll = log --pretty=tformat:"%C(yellow)%h%Cred%d\\ %Creset%s%C(cyan)\\ [%an]" --decorate --numstat -1
View Application.qml
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.2
import QtMultimedia 5.0
Window {
id: mainWindow
title: "QApplication"