Skip to content

Instantly share code, notes, and snippets.

View likewhoa's full-sized avatar

likewhoa likewhoa

View GitHub Profile
@likewhoa
likewhoa / delete-all-messages.js
Last active April 6, 2018 02:52 — forked from IMcPwn/delete-all-messages.js
Delete all messages in a Discord channel
// 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();
@likewhoa
likewhoa / gist:61725382bc1baeb1788bf2946c5d074a
Created February 22, 2017 04:14 — forked from knoguchi/gist:6952087
get financial report from Google Finance
#!/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
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
@likewhoa
likewhoa / BS_test.py
Last active January 2, 2016 11:09 — forked from newbiethetest/tes.py
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()
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)
@likewhoa
likewhoa / ftp.py
Created January 7, 2014 05:43 — forked from newbiethetest/ftp.py
# -*- 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
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
# -*- coding:utf8 -*-
import urllib
import curl
import pycurl
import StringIO
def initCurl():
c=pycurl.Curl()
c.setopt(pycurl.FOLLOWLOCATION,0)