This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import copy | |
import time | |
import math | |
import heapq | |
import argparse | |
FINFINITY = 5000 | |
USAGE = "python puzzle8.py [bfs|idfs|astar|idastar]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run: | |
# $ virtualenv env | |
# $ cd env | |
# $ env/bin/pip install watchdog | |
# $ env/bin/pip install selenium | |
# $ env/bin/python sphinx-reload.py | |
import logging | |
import os | |
import selenium.webdriver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import subprocess | |
import sys | |
from urllib import pathname2url | |
import selenium.webdriver | |
def run(): | |
watch_command = 'inotifywait -rq -e close_write --exclude \'"*.html"\' .'.split() | |
make_command = 'make html'.split() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<manifest> | |
<project name="androidarmv6/android_device_lge_p500" path="device/lge/p500" remote="github" /> | |
<project name="androidarmv6/android_kernel_lge_msm7x27-3.0.x" path="kernel/lge/msm7x27-3.0.x" remote="github" /> | |
<project name="androidarmv6/android_device_qcom_msm7x27" path="device/qcom/msm7x27" remote="github" /> | |
<project name="androidarmv6/android_device_lge_msm7x27-common" path="device/lge/msm7x27-common" remote="github" /> | |
<project name="androidarmv6/android_vendor_lge" path="vendor/lge" remote="github" /> | |
<project name="androidarmv6/android_vendor_qcom_msm7x27" path="vendor/qcom/msm7x27" remote="github" /> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<manifest> | |
<remote name="aosp" | |
fetch="https://android.googlesource.com" | |
review="android-review.googlesource.com" /> | |
<remote name="github" | |
fetch=".." | |
review="review.androidarmv6.org" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tempfile | |
import subprocess | |
import timeit | |
class GitWorkerPipe(object): | |
def start(self): | |
cmd = subprocess.Popen(["git", "pull"], stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3 git_pull.py :( | |
Username for 'https://bitbucket.org': XXX | |
Password for 'https://[email protected]': | |
b'Already up-to-date.\n' | |
b'' | |
73.81498788599856 | |
Username for 'https://bitbucket.org': XXX | |
Password for 'https://[email protected]': | |
0 | |
b'Already up-to-date.\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# Of course, the author does not guarantee safety. | |
# I did my best by using SQLite's online backup API. | |
from __future__ import print_function | |
import sys, ctypes | |
from ctypes.util import find_library | |
SQLITE_OK = 0 | |
SQLITE_ERROR = 1 | |
SQLITE_BUSY = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function (){ var scripts = document.getElementsByTagName('script'); var friendsList; for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if (script.innerHTML.indexOf('InitialChatFriendsList') > -1) { var friendsListString = script.innerHTML.split('"InitialChatFriendsList",[],{"list":')[1].split(',"groups"')[0]; friendsList = JSON.parse(friendsListString); console.log('friendsList:', friendsList); break; } } var html = friendsList.map(function(id, i){ id = id = id.split('-')[0]; var url = 'http://graph.facebook.com/' + id + '/picture?type=normal'; return '<a target="_blank" href="https://www.facebook.com/' + id + '"><img src="' + url + '"></a>'; }).join('\n'); var css = '<style> a { display: inline-block; margin: 7px; } img { max-width: 70px; max-height: 70px; vertical-align: top; } </style>'; open('data:text/html, <html>' + css + html + '</html>'); }()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
import shutil | |
import os | |
import subprocess | |
is_win = (sys.platform == 'win32') | |
req_file = "req.txt" | |
home_dir = os.path.dirname(os.path.abspath(__file__)) |
OlderNewer