You can send arbitrary commands over the protocol fairly easily.
Main.sendOverProtocol('Emulation.setDeviceMetricsOverride', nexus5XMetrics());
Main.sendOverProtocol("Emulation.clearDeviceMetricsOverride");
// It returns a promise
javascript:var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIt |
var dispatch = InspectorBackendClass.Connection.prototype.dispatch; | |
InspectorBackendClass.Connection.prototype.dispatch = function() { | |
if (arguments && arguments.length > 0) { | |
var message = arguments[0]; | |
var object = message ? JSON.parse(message) : {}; | |
console.log.apply(console,['events', object]); | |
} | |
dispatch.apply(this, arguments); | |
} |
// Import Ale's fantastic Sketch Sandbox | |
// https://github.com/bomberstudios/sketch-sandbox | |
#import 'sketch-sandbox.js' | |
// Are we on a page or an artboard? | |
var page = doc.currentPage(); | |
var canvas = page.currentArtboard() ? page.currentArtboard() : page; | |
// Define the location of the file you want to import, using file:// protocol | |
var fileURL = NSURL.URLWithString("file:///Users/johndoe/Downloads/my_cat.svg"); |
What is the release date for 2.0? | |
No exact release date yet. They don't want what happened with 1.2.They want to | |
make sure they get it done right for 2.0 so they are not setting a date yet. | |
What is the plan for having a migration path for 2.0? How much rewriting of 1.x | |
apps will need to be done to migrate to 2.0? | |
Mishko said that there will definitely be a migration plan for 2.0. They dont know |
from urlparse import urlparse | |
from Crypto.Hash import MD2 | |
import pandas as pd | |
import cookies as ck | |
import hackercodecs # noqa | |
import hashlib | |
import pyblake2 | |
import urllib | |
import sha3 | |
import mmh3 |
response.writeHead(200, { | |
'p3p': ['policyref="http://foo.com/p3p.xml"', 'CP="OOO EEE OOH AH AHH"'], | |
'Set-Cookie': ['ting="tang; expires=0; path=/;"', 'wallawalla="bingbang; expires=123456789; path=/;"'], | |
'Content-Type': 'text/html' | |
}); |
/** | |
* Track JS error details in Universal Analytics | |
*/ | |
function trackJavaScriptError(e) { | |
var errMsg = e.message; | |
var errSrc = e.filename + ': ' + e.lineno; | |
ga('send', 'event', 'JavaScript Error', errMsg, errSrc, { 'nonInteraction': 1 }); | |
} | |
#!/usr/bin/env bash | |
# | |
# Approach: | |
# 1. Find variable declaration in the form of "$my-var: anyvalue" | |
# 2. Loop through found variables and find occurrences of each variable in all sass files | |
# 3. Filter out vars that occurred only once | |
if [ -z "$1" ]; then | |
echo "Please specify a directory as the first argument." | |
exit 1 |
I've heard this before:
What I really get frustrated by is that I cannot wrap
console.*
and preserve line numbers
We enabled this in Chrome DevTools via blackboxing a bit ago.
If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.