Skip to content

Instantly share code, notes, and snippets.

function hab_hide(el) {
$(arr[el]).parent().parent().children('.reply_comments').hide()
}
function hab_show(el) {
$(arr[el]).parent().parent().children('.reply_comments').show()
}
var arr = $('.comment_item .comment_body .info');
for(i=0; i < arr.length; i++) $(arr[i]).children('.clear').before(
@kirillsulim
kirillsulim / Python-status-mock-server
Created July 17, 2014 06:35
Python-status-mock-server
import SimpleHTTPServer
import SocketServer
class MyHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(504)
self.send_header("Content-type", "text/html")
self.end_headers()
def do_POST(self):
@kirillsulim
kirillsulim / Pinger
Created July 29, 2014 16:02
Ping google dns every 30 seconds
:point
ping 8.8.8.8
timeout 30
goto point
@kirillsulim
kirillsulim / bash.im_link_gen
Created December 8, 2014 08:07
Generate html with all bash.im/abyssbest for last year (site restriction)
@kirillsulim
kirillsulim / DirCleaner
Last active August 29, 2015 14:13
Delete all files and subfolders in selected folder
rem no " " in dir name
rem downloads: %UserProfile%\Downloads
rem tmp: %tmp%
set clean_dir=%UserProfile%\Downloads
del /s /q "%clean_dir%\*"
FOR /D %%p IN ("%clean_dir%\*.*") DO rmdir "%%p" /s /q
@kirillsulim
kirillsulim / bad
Last active August 29, 2015 14:13
command = input("Введите команду")
if command == "exit":
exit()
else:
if command == "help":
help()
else:
if command == "hello":
print("hello!")
command = input("Введите команду")
if command == "exit":
exit()
elif command == "help":
help
elif command == "hello":
print("hello!")
else
print("Нет такой команды")
from PIL import Image, ImageFilter, ImageDraw
import random
img = Image.open("1.jpg")
width = img.size[0]
height = img.size[1]
mask = Image.new('L', img.size, 255)
maskd = ImageDraw.Draw(mask)
@kirillsulim
kirillsulim / Hello World
Created May 14, 2015 13:37
BF simple Hello world
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
++++++++++++++++++++++++++++++++.>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>
# This script will dump your history into out.txt
# Run script, authorize app, get token in url
# Enter token into script
# Enjoy out.txt
import requests
import webbrowser
import json
import datetime