Skip to content

Instantly share code, notes, and snippets.

class test:
def __init__(self):
self.a = 1
@classmethod
def foo(cls, p, flag):
pass
def foo(self, p):
print(self.a)
{ "name": "Tumblr full size images"
, "version": "1.0"
, "description": "Never show image thumbnails on tumblr"
, "homepage_url": "https://gist.github.com/johan/6336414"
, "manifest_version": 2
, "content_scripts":
[ { "js":
[ "tumblr-full-size-images.user.js"
]
, "matches":
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
#!/bin/sh
# use `printf "\033[{{STYLE}};{{FOREGROUND_COLOR}};{{BACKGROUND_COLOR}}m"` to set the color of all the output from the shell
# use `printf "\033[0m"` to reset
for attr in 0 1 4 5 7 ; do
echo "----------------------------------------------------------------"
printf "ESC[%s;Foreground;Background - \n" $attr
for fore in 30 31 32 33 34 35 36 37; do
for back in 40 41 42 43 44 45 46 47; do
#!/bin/sh
printf "\033[5;31;40m";
echo " █████▒█ ██ ▄████▄ ██ ▄█▀";
echo "▓██ ▒ ██ ▓██▒▒██▀ ▀█ ██▄█▒ ";
echo "▒████ ░▓██ ▒██░▒▓█ ▄ ▓███▄░ ";
echo "░▓█▒ ░▓▓█ ░██░▒▓▓▄ ▄██▒▓██ █▄ ";
echo "░▒█░ ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄";
echo " ▒ ░ ░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░▒ ▒▒ ▓▒";
echo " ░ ░░▒░ ░ ░ ░ ▒ ░ ░▒ ▒░";
function newCounter()
local i = 0
return function() -- anonymous function
i = i + 1
return i
end
end
c1 = newCounter()
print(c1()) --> 1
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@wenLiangcan
wenLiangcan / pyv.py
Created July 18, 2014 07:50
Find out-of-date modules
import json
from distutils.version import LooseVersion
import pip
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
@wenLiangcan
wenLiangcan / prun.py
Last active August 29, 2015 14:05 — forked from zhangchunlin/prun
#! /usr/bin/env python
#coding=utf-8
import gevent
from gevent.subprocess import Popen, PIPE
import sys
def run(cmd,name="",index=1,color=True):
fc = 32 + index%5
if name: