Skip to content

Instantly share code, notes, and snippets.

$ python -c "import xmlrpc.client, re; invalid = [x for x in xmlrpc.client.ServerProxy('https://pypi.python.org/pypi').list_packages() if not re.search(r'^[a-zA-Z0-9_.-]+$', x)]; print('%s total' % len(invalid)); print('\n'.join(invalid))"
229 total
Aaaaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaasa aaaaaaasa aaaaasaa aaaaaaasa bbbbbbbbbbb
abo's pysync
AdvaS Advanced Search
AL - Application Launcher
Amara XML Toolkit
AnkiDecks site
Aplicacion de ejemplo
@imxiaohui
imxiaohui / catiabom.py
Created August 22, 2013 09:08
Automate CATIA V5 with Python and Pywin32 (Python recipe)
import win32com.client
catapp = win32com.client.Dispatch("CATIA.Application")
doc=catapp.ActiveDocument.Product
product_count = doc.Products.Count
print "This example lists all Parts and Subproducts of the first level from a CATProduct."
for products in range(product_count):
products = products + 1
print doc.Products.Item(products).Name, ":"
part_count = doc.Products.Item(products).Products.Count
#!/usr/bin/env python3
import os
import sys
import glob
import shutil
import argparse
from stat import *
def main(args):
@imxiaohui
imxiaohui / abqall.bat
Created August 23, 2013 04:18
run all inp in current folder
@echo off
FOR %%f IN (*.inp) DO CALL abq2u.bat %%f
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
#!/bin/sh
# ============================
# = Editing Files with 'sed' =
# ============================
# 'sed' stands for Stream EDitor and is used to edit files automatically. It reads a file line by line, edits each line as directed by a
# list of commands, and spits out the changed line. 'sed' does a lot, much more than I can cover in this tutorial. A fuller tutorial on
# 'sed' will appear in an Advanced Lesson.
#
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
@imxiaohui
imxiaohui / mkhelix.py
Created February 28, 2014 03:31 — forked from jl2/mkhelix.py
#!/usr/bin/env python3
import sys
import array
import math
import random
import os.path
import win32com.client
def get_catia():

Useful commands

last_response
    .body

last_request
    .path
    .url
    .session

.cookies

@imxiaohui
imxiaohui / main.go
Last active August 29, 2015 14:11 — forked from nmerouze/main.go
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"