Skip to content

Instantly share code, notes, and snippets.

oglops

Block or report user

Report or block oglops

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@oglops
oglops / fix_tomato_gui_clean.py
Last active Sep 24, 2017
restore leading spaces/tabs/newlines from original www files
View fix_tomato_gui_clean.py
import os
import re
cn_dir = '~/github/tomato-gui'
en_dir = '~/github/tomato-gui-en'
cn_dir = os.path.expanduser(cn_dir)
en_dir = os.path.expanduser(en_dir)
@oglops
oglops / build.sh
Created Jul 13, 2017
build svn in csh
View build.sh
# build serf lib first
scons PREFIX=$HOME/Downloads/serf-install
scons install
# run one line command with temp env var
( make distclean ; setenv LDFLAGS -Wl,-rpath,\\\$\$ORIGIN/../lib ; ./configure --prefix=$HOME/svn --with-serf=$HOME/Downloads/serf-install ; make ; make install)
View after changing to LT_INIT it turns out i don't need to after adding dirlist
cd /home/oglop/tomato/release/src-rt/router/libjson-c && CC=mipsel-uclibc-gcc STRIP=mipsel-uclibc-strip \
./autogen.sh && \
./configure --host=mipsel-linux --build=x86_64-redhat-linux --prefix=/usr
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
@oglops
oglops / gist:7120f0fcd1a9be31959221b4caf048c4
Created Jul 4, 2017 — forked from manuelmacha/gist:6cc29ec040734e21a768
QTextEdit extended with a signal 'lineNumbersChanged' which gets triggered when the line-numbers of the visible text change. Such functionality already exists for QPlainTextEdit via firstVisibleBlock().blockNumber() and lastVisibleBlock().blockNumber(). However these methods are not accessible using QTextEdit and PyQt. The signal can be used to …
View gist:7120f0fcd1a9be31959221b4caf048c4
from PyQt4 import QtGui, QtCore
class TextEdit(QtGui.QTextEdit):
'''
QTextEdit extended with a signal 'lineNumbersChanged' which gets triggered when the line-numbers of the visible text change.
Such functionality already exists for QPlainTextEdit via firstVisibleBlock().blockNumber() and lastVisibleBlock().blockNumber()
However these functions are not accessible using QTextEdit and PyQt.
The signal can be used to update custom widgets that compliment the QTextEdit such as lineNumberWidgets or miniMapWidgets.
'''
@oglops
oglops / gifplayer.html
Last active Jul 2, 2017
qwebview load() does not need to load js and css manually
View gifplayer.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>gifplayer</title>
<base href="http://rubentd.com"></base>
<link rel="stylesheet" type="text/css" href="bower_components/jquery.gifplayer/dist/gifplayer.css"></link>
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/jquery.gifplayer/dist/jquery.gifplayer.js"></script>
<script>
@oglops
oglops / 1.html
Created Jun 30, 2017
qwebview visited link color not changing ?
View 1.html
<html>
<head>
<title></title>
<meta content="">
<style></style>
</head>
<body>
page 1
<a href="2.html"> open page 2</a>
</body>
@oglops
oglops / gifplayer.css
Last active Jun 29, 2017
use gifplayer jquery plugin in qwebview to control gif, user-select: none; hides blinking text cursor when used in an editable qwebview
View gifplayer.css
ins.play-gif{
position: absolute;
font-family: Arial, sans serif;
width: 50px;
height: 50px;
line-height: 52px;
text-align: center;
background: #222;
font-size: 18px;
@oglops
oglops / pyqt4_webkit_video_css.py
Created Jun 27, 2017
Load one or multiple css files into qwebview
View pyqt4_webkit_video_css.py
import sys
from PyQt4.QtWebKit import QWebView, QWebInspector, QWebSettings
from PyQt4.QtGui import QApplication, QDialog, QHBoxLayout
from PyQt4.QtCore import QUrl, QByteArray, QString
class Dialog(QDialog):
def __init__(self, parent=None):
View mayaWidgetEmbeddingIntoPyQtWidget.py
import maya.OpenMayaUI
import maya.cmds as cmds
import sip
from PyQt4.QtGui import *
from PyQt4.QtCore import *
mainWindow = QMainWindow()
centralWidget = QListView()
mainWindow.setCentralWidget(centralWidget)
dockWidget = QDockWidget("DockWidget", mainWindow)
@oglops
oglops / contextDecorator3.py
Last active May 12, 2017
test classmethod
View contextDecorator3.py
#!/usr/bin/env python
from abc import ABCMeta, abstractmethod
from functools import wraps
import time
class ContextDecorator(object):
_built = False
You can’t perform that action at this time.