A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| ########## SETTINGS | |
| # On startup, lftp executes ~/.lftprc and ~/.lftp/rc. You can place aliases and 'set' commands | |
| # there. Some people prefer to see full protocol debug, use 'debug' to turn the debug on. | |
| # Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is time amount | |
| # (floating point) and x is time unit: d - days, h - hours, m - minutes, s - seconds. Default unit is second. E.g. | |
| # 5h30m or 5.5h. Also the interval can be 'infinity', 'inf', 'never', 'forever' - it means infinite interval. E.g. | |
| # 'sleep forever' or 'set dns:cache-expire never'. |
| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:$i:1}" | |
| case $c in |
| // preserve Twitter's style of JSON string encoding... | |
| // escape higher value unicode (lowercase hex) | |
| // escape < and > (uppercase hex) | |
| // escape / in strings (\/) | |
| // hugs! https://gist.github.com/1306986 | |
| // http://stackoverflow.com/questions/4901133/json-and-escaping-characters | |
| function escapedStringify(s, emit_unicode) { | |
| var json = JSON.stringify(s); | |
| return emit_unicode ? json : json.replace(/\//g, | |
| function(c) { |
| var utils = function(){ | |
| "use strict"; | |
| var _class2type = {}; | |
| var _type = function( obj ) { | |
| return obj == null ? | |
| String( obj ) : | |
| _class2type[ toString.call(obj) ] || "object"; | |
| }; |
| import SimpleHTTPServer | |
| class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| def send_head(self): | |
| """Common code for GET and HEAD commands. | |
| This sends the response code and MIME headers. | |
| Return value is either a file object (which has to be copied | |
| to the outputfile by the caller unless the command was HEAD, | |
| and must be closed by the caller under all circumstances), or |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
| http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
| version="1.0"> | |
| <!-- derby --> |
| CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french ); | |
| ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING | |
| FOR hword, hword_part, word WITH unaccent, french_stem; | |
| CREATE TEXT SEARCH CONFIGURATION en ( COPY = english ); | |
| ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING | |
| FOR hword, hword_part, word WITH unaccent, english_stem; | |
| CREATE TEXT SEARCH CONFIGURATION de ( COPY = german ); | |
| ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING |
| APIKEY=""; | |
| for f in old/*.png | |
| do | |
| echo "Compressed- $f" | |
| OPT=`curl -i --user api:$APIKEY --data-binary @$f https://api.tinypng.com/shrink | sed -ne 's/.*"\(http[^"]*\).*/\1/p'` | |
| echo $OPT | |
| ORG_FILE=`sed "s/old\///g" <<<"$f"` | |
| curl $OPT -o new/$ORG_FILE | |
| done |