Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
const dbName = "users"; // | |
const tableName = "dbsignin"; // | |
const dbReq = indexedDB.open(dbName, 1); | |
const dumpTable = function(event) { | |
const db = dbReq.result; | |
const objectStore = db.transaction([tableName]).objectStore(tableName); | |
objectStore.openCursor().onsuccess = (event) => { | |
const cursor = event.target.result; | |
if (cursor) { |
const deobfuscate = (obfuscated) => { | |
var vm = require('vm'); | |
let constructor = "[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]"; | |
let code = obfuscated.replace(constructor, '').replace(/\(\)$/, '').replace(/^\(/, '').replace(/\)$/, '') |
var sleep = require('sleep').sleep; | |
process.on('message', function (message) { | |
console.log('message from parent:', message); | |
}); | |
if (process.send) { | |
for (let i=0, len = 100; i < len; i++) { | |
sleep(1); | |
process.send(`Hello-${i}`); |
let canvas = document.querySelector('canvas'); | |
// Optional frames per second argument. | |
let stream = canvas.captureStream(25); | |
let recorder = new MediaRecorder(stream, options); | |
let blobs = []; | |
function download(blob) { | |
var url = window.URL.createObjectURL(blob); | |
var a = document.createElement('a'); | |
a.style.display = 'none'; |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
var page = require('webpage').create(); | |
var system = require('system'); | |
page.onConsoleMessage = function(msg) { | |
system.stderr.writeLine('Console Message: ' + msg); | |
}; | |
page.onInitialized = function() { | |
page.evaluate(function() { | |
document.addEventListener('DOMContentLoaded', function() { |
10a11,13 | |
> apt-get install -y aptitude | |
> aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` | |
> add-apt-repository ppa:ondrej/php | |
16,19c19,22 | |
< apt-get install -y php5 | |
< apt-get install -y php5-common | |
< apt-get install -y php5-curl | |
< apt-get install -y libapache2-mod-php5 | |
--- |
The postMessage()
API is an HTML5 extension that permits string
message-passing between frames that don't share the same origin. It
is available in all modern browsers. It is not supported in IE6 and
IE7.
postMessage is generally considered very secure as long as the programmer is careful to check the origin and source of an arriving
import os | |
import numpy | |
from pandas import DataFrame | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.naive_bayes import MultinomialNB | |
from sklearn.pipeline import Pipeline | |
from sklearn.cross_validation import KFold | |
from sklearn.metrics import confusion_matrix, f1_score | |
NEWLINE = '\n' |
function matchInArray(arr, subject) { | |
var parser = document.createElement('a'); | |
parser.href = subject; //using DOM-trickery to parse URLs | |
if(Object.prototype.toString.call(arr) !== '[object Array]') { | |
arr = arr.split(); //array typecast | |
} | |
if((new RegExp('\\b' + arr.join('\\b|\\b') + '\\b')).test(parser.hostname)) { | |
return true; |