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
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom) | |
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right. | |
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID. | |
// Copy / paste the below script into the JavaScript console. | |
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages). | |
var before = '431478432950648842'; | |
clearMessages = function(){ | |
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, ""); | |
const channel = window.location.href.split('/').pop(); |
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 | |
""" | |
Get financial data from Google Finance. | |
Requirment: | |
pyquery 1.2.6. (1.2.1 did not work) | |
Report types: | |
inc - income statement | |
bal - balance sheet |
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
To download changes from an old livedvd iso image to a new one without having to redownload the whole image, do the following. | |
1. emerge zsync | |
2. zsync -i oldimage.iso http://releases.gentooligans.com/newimage.iso.zsync | |
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 Queue | |
import threading | |
import urllib2 | |
import time | |
from BeautifulSoup import BeautifulSoup | |
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com", | |
"http://ibm.com", "http://apple.com"] | |
queue = Queue.Queue() |
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 pycurl | |
import StringIO | |
import re | |
def initCurl(): | |
c=pycurl.Curl() | |
#c.setopt(pycurl.COOKIEFILE,"cookie_file_name") | |
#c.setopt(pycurl.COOKIEJAR,"cookie_file_name") | |
c.setopt(pycurl.FOLLOWLOCATION,0) | |
c.setopt(pycurl.CONNECTTIMEOUT, 1) # | |
c.setopt(pycurl.MAXREDIRS,1) |
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
# -*- coding:utf8 -*- | |
__author__ = 'newbie0086#foxmail.com' | |
import Queue | |
import threading | |
from ftplib import FTP | |
import os,sys,string,datetime,time | |
import socket | |
class MyFtp: | |
def __init__(self,host,username,password,port=21): | |
self.host=host |
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
queue = Queue.Queue() | |
out_queue = Queue.Queue() | |
class ThreadUrl(threading.Thread): | |
"""Threaded Url Grab""" | |
def __init__(self, queue, out_queue): | |
threading.Thread.__init__(self) | |
self.queue = queue | |
self.out_queue = out_queue |
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
# -*- coding:utf8 -*- | |
import urllib | |
import curl | |
import pycurl | |
import StringIO | |
def initCurl(): | |
c=pycurl.Curl() | |
c.setopt(pycurl.FOLLOWLOCATION,0) |