onelinetips
-
remove html or xml character refs (e.g. ’) and entities from text string:
4:25 PM Nov 27th
from API
-
quick and easy way to remove non-ascii characters from a string: filter(lambda c: ord(c) < 128, s)
8:20 AM Nov 19th
from API
-
@ indeed -- thanks for the correction!
8:19 AM Nov 19th
from Tweetie
in reply to tclancy
-
use !, ^, etc. for quick navigation of previous commands
1:52 PM Nov 17th
from API
-
use parameter expansion to remove file extensions in shell scripts, e.g. ${file%\.*}
7:32 AM Nov 15th
from API
-
to create a nested defaultdict of defaultdicts, use d = defaultdict(lambda : defaultdict(int))
6:20 PM Oct 12th
from API
-
use tcdump to capture packet traffic sudo
2:32 PM Aug 17th
from API
-
use java.util.Hashtable for a hashtable
2:54 PM Aug 10th
from API
-
script from @ to transparently use gnu screen over ssh for persistent logins
10:22 AM Aug 6th
from API
-
to fix 403 forbidden error on apache in 10.5 (leopard), create appropriate /etc/apache2/users/user.conf file
10:12 AM Aug 4th
from API
-
use show tables like "table_name" to see if a table exists
10:21 AM Jul 28th
from API
-
return rows as dicts with mysqldb using the DictCursor class
10:20 AM Jul 28th
from API
-
use postfix to send smtp gmail from the command line on mac/linux
8:25 PM Jul 15th
from API
-
use spdiags to row-wise (or column-wise) normalize a sparse matrix (via @)
3:10 PM Jul 13th
from API
-
use sudo ifconfig en1 lladdr 00:11:22:33:44:55:66 to spoof your airport mac (hardware) address
2:43 PM Jun 29th
from web
-
use sort's -S option to set main memory buffer size to speed up large sorts (via @)
10:58 AM Jun 24th
from web
-
use a join wrapped around a list comprehension for fast string appends
3:13 PM Jun 16th
from web
-
appending Strings with += is very slow; use StringBuffer.append() instead (via @)
3:11 PM Jun 16th
from web
-
use cd - to return the previous working directory (also via @)
2:20 PM Jun 12th
from web
-
use the -C option when scp-ing text for a compression speed-up (via @)
2:18 PM Jun 12th
from web
|
- Name onelinetips
- Web http://jakehofman...
- Bio one line geek tips, provided by @jakehofman (frequency: few tips per week)
|