Skip to content

Instantly share code, notes, and snippets.

@liudonghua123
liudonghua123 / wechat_getappmsgext.py
Created April 6, 2016 07:27 — forked from chen206/wechat_getappmsgext.py
微信公众号文章抓取阅读数和点赞数
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
from urlparse import urlparse, parse_qs
import requests
@liudonghua123
liudonghua123 / pyside_dynamic.py
Created September 6, 2022 04:34 — forked from cpbotha/pyside_dynamic.py
pyside_dynamic.py with minor improvements - also see http://stackoverflow.com/a/14894550/532513
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# Copyright (c) 2011 Sebastian Wiesner <lunaryorn@gmail.com>
# Modifications by Charl Botha <cpbotha@vxlabs.com>
# * customWidgets support (registerCustomWidget() causes segfault in
# pyside 1.1.2 on Ubuntu 12.04 x86_64)
# * workingDirectory support in loadUi
# found this here:
# https://github.com/lunaryorn/snippets/blob/master/qt4/designer/pyside_dynamic.py
@liudonghua123
liudonghua123 / idb-backup-and-restore.md
Created August 4, 2022 18:39 — forked from loilo/idb-backup-and-restore.md
Back up and restore an IndexedDB database

Back up and restore an IndexedDB database

This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).

Usage

For each of the provided functionalities, you need a connected IDBDatabase instance.

Export Data

import { idb } from 'some-database'
@liudonghua123
liudonghua123 / main.dart
Last active September 15, 2022 08:31
add some operator override on Set date type
// https://www.geeksforgeeks.org/python-set-operations-union-intersection-difference-symmetric-difference/
// https://dart.cn/guides/language/extension-methods#implementing-generic-extensions
// https://api.dart.cn/stable/2.18.1/dart-core/Set-class.html
extension EhancedSet<T> on Set<T> {
Set<T> operator |(Set<T> anotherSet) => union(anotherSet);
Set<T> operator &(Set<T> anotherSet) => intersection(anotherSet);
Set<T> operator -(Set<T> anotherSet) => difference(anotherSet);
Set<T> operator ^(Set<T> anotherSet) => union(anotherSet).difference(intersection(anotherSet));
}
@liudonghua123
liudonghua123 / repl.dart
Created September 8, 2022 02:01 — forked from maks/repl.dart
Example of basic Dart REPL using vm_service package
import 'dart:developer' as dev;
import 'dart:io';
import 'package:vm_service/vm_service.dart' show InstanceRef, VmService;
import 'package:vm_service/vm_service_io.dart' as vms;
import 'package:vm_service/utils.dart' as vmutils;
// based on early version of:
// https://github.com/BlackHC/dart_repl/
// and example in:
// https://github.com/dart-lang/sdk/blob/master/pkg/vm_service/example/vm_service_tester.dart
@liudonghua123
liudonghua123 / gist:4cb98f4ef1a12eb23fb9056377795c9d
Created January 3, 2018 03:35 — forked from mems/gist:5301297
How to convert a (simple) SWF to PDF

Convert (simple) SWF to PDF

In SWFTools a programs called gfx2gfx is available to do this task, but it's not officially available precompiled.

It can convert SWF, PDF or image to SWF, PDF, ebook or image.

For discard downscaling for rasterized image (default: 72dpi) we use the provided by @m-p-y: add -r attribute to increase maxdpi

Requirements

@liudonghua123
liudonghua123 / django-branches-svn2git.rst
Created May 11, 2022 01:35 — forked from ramiro/django-branches-svn2git.rst
Importing Django branches from SVN to Git{,Hub}?

Importing Django branches (and merges) from SVN to our GitHub repo

Versions used:

$ svn --version
svn, version 1.6.17 (r1128011)
compiled Nov 20 2011, 03:42:58
...
@liudonghua123
liudonghua123 / For Mac 4.2.6 unlimited trial.md
Created May 5, 2022 05:05 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6,4.3.7,it's works , this is the way which makes Always in evaluation mode 。

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare : touch BCompare && chmod a+u BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@liudonghua123
liudonghua123 / SMBDIS.ASM
Created April 29, 2022 08:40 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no