Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

LI Daobing lidaobing

💭
I may be slow to respond.
View GitHub Profile
View .bashrc
if [ `uname` = 'Darwin' ]; then
if [ `arch` = 'arm64' ]; then
export PATH="/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:$PATH"
PS1_ARCH="[ARM]"
else
export PATH="/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:$PATH"
PS1_ARCH="[X86]"
fi
export PS1="$PS1_ARCH$PS1"
alias ibrew="arch -x86_64 /usr/local/bin/brew"
View sigc_test.cpp
#include <iostream>
#include <sigc++/signal.h>
using namespace std;
class A {
public:
sigc::signal<void()> s1;
};
View GioTest.cpp
// Result:
// signal does not depends on main loop
// GSimpleAction is a very useful tool for DocView model
#include <gio/gio.h>
namespace {
bool c1 = false;
bool c2 = false;
void callback1() {
View 1.patch
diff --git a/wrapper/ibus/setup/main.py b/wrapper/ibus/setup/main.py
index e20a3a5..396c514 100644
--- a/wrapper/ibus/setup/main.py
+++ b/wrapper/ibus/setup/main.py
@@ -39,10 +39,12 @@ import os
from os import path
try:
import gtk
+ import glib
except ImportError:
View github-issues-to-bitbar.py
#!/usr/bin/env /usr/local/bin/python3
import netrc
import requests
import json
class Task:
def __init__(self, number, title, url, assignee):
self.number = number
self.title = title
View test.md
sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
    loop Healthcheck
        John->John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail...
    John-->Alice: Great!
View main.py
#coding=utf-8
import json, os, sys, uuid, datetime, subprocess, traceback
def runCmd(cmd):
return [str(x) for x in subprocess.check_output(cmd, shell=True).splitlines()]
def getServerId():
try:
View jdcloud_apim_mock.py
#coding=utf-8
import http.server
import socketserver
import datetime
import uuid
from urllib.parse import urlparse, parse_qs
__all__ = ['run']
View 1.py
#coding=utf-8
import json, os, sys, uuid, datetime, subprocess, traceback
def runCmd(cmd):
return [str(x) for x in subprocess.check_output(cmd, shell=True).splitlines()]
def getServerId():
try:
View gist:c170e8e01a373a6aba1dfca3fd42a0ea
$ /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --incognito
2018-06-22 14:17:59.951 Google Chrome[40276:1972298] ApplePersistence=NO
2018-06-22 14:18:00.072 Google Chrome[40276:1972298] *** Owner supplied to -[NSTrackingArea initWithRect:options:owner:userInfo:] referenced a deallocating object. Tracking area behavior is undefined. Break on NSTrackingAreaDeallocatingOwnerError to debug.
[40276:775:0622/141802.651790:ERROR:display_info_provider_mac.cc(16)] Not implemented reached in virtual void extensions::DisplayInfoProviderMac::UpdateDisplayUnitInfoForPlatform(const display::Display &, extensions::api::system_display::DisplayUnitInfo *)
2018-06-22 14:18:02.691 1PasswordNativeMessageHost[40308:1972837] 70004001 [EXT_NMH:(Main Thread):<OnePasswordNativeMessageHost: 0x7f80bbe05830>] E run | Launched
2018-06-22 14:18:02.692 1PasswordNativeMessageHost[40308:1972837] 70004001 [EXT_NMH:(Main Thread):<OPNMXPCConnection: 0x7f80bbe1b110>] E connect | Attempting to connect
2018-06-22 14:18:02.948 1Pas