Skip to content

Instantly share code, notes, and snippets.

View binux's full-sized avatar

Roy Binux binux

View GitHub Profile
@binux
binux / iframe.html
Last active June 22, 2020 23:46
cross origin iframe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<iframe src="sub_frame.html" width="640" height="480"></iframe>
<iframe src="https://httpbin.org/html" width="640" height="480"></iframe>
</body>
</html>
const {app, BrowserWindow} = require('electron')
app.once('ready', async () => {
win = new BrowserWindow()
win.webContents.session.webRequest.onBeforeSendHeaders((details, callback) => callback({}));
win.webContents.once('did-finish-load', async () => {
const html = await win.webContents.executeJavaScript('document.documentElement.innerHTML');
console.log(html);
app.quit()
})
await win.webContents.loadURL('https://httpbin.org/headers', {"extraHeaders":"Addition-Header: hello world"})
@binux
binux / index.html
Last active January 5, 2018 14:51 — forked from anonymous/index.html
JS Bin// source http://jsbin.com/jaqavetema
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="pos"></span>
<canvas id="myCanvas" width="1024" height="728"></canvas>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
</head>
<body>
<script id="jsbin-javascript">
const search = (location.search.match(/q=([^&]+)/) || [null, "1"])[1];
const iframe = document.createElement('iframe');
@binux
binux / bookmark.js
Last active December 21, 2017 15:10
generate css selector for data extraction
javascript:(function (){document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).src='https://gistcdn.githack.com/binux/fb853cd4f4d699d178e66c699b58be68/raw/css_selector_helper.js';}());
@binux
binux / index.html
Last active December 20, 2017 20:40 — forked from anonymous/index.html
JS Bin// source http://jsbin.com/zitojijuda
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form action="https://book.jetblue.com/B6/webqtrip.html" method=POST>
<button type=submit>submit</submit> <br />
@binux
binux / pyproxy.sh
Last active October 27, 2016 09:23
A script to run proxy in docker. `/bin/bash -c "$(wget -q -O - https://gist.github.com/binux/60c3d22070f18bf396a85c43c43fb2bd/pyproxy.sh)" bash --bind=0.0.0.0`
#!/bin/bash
python -c "$(wget -O - https://bootstrap.pypa.io/get-pip.py)"
python -m pip install pyproxy
python -c "from pyproxy import main;main();" $@
#!/usr/bin/python
swf = open('core.swf').read()
KEY = 'dkrltl0%4*@jrky#@$'
def decrypt(p1, p2=1):
l3 = None
l5 = 0
l6 = 0
l7 = 0
#!/usr/bin/python
# filename: parse_dblp.py
# author: ivanchou
import codecs, os
import xml.etree.ElementTree as ET
paper_tag = ('article','inproceedings','proceedings','book',
'incollection','phdthesis','mastersthesis','www')
class AllEntities:
import threading
import tornado
import tornado.httpserver
import tornado.websocket
wss = []
class WSHandler(tornado.websocket.WebSocketHandler):
def check_origin(self, origin):