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
find . -name "*.extension" | xargs -I{} perl -pi -e 's/old-name/new-name/g' {} |
#!/bin/bash | |
PWD=$(pwd) | |
GIT_ROOT=~/workspace | |
CYAN='\033[36m' | |
GREEN='\033[32m' | |
NC='\033[0m' # No Color | |
cd $GIT_ROOT > /dev/null |
#!/bin/sh | |
remove_dangling() { | |
echo "Removing dangling images ..." | |
docker rmi $(docker images -f dangling=true -q) | |
} | |
remove_stopped_containers() { | |
echo "Removing stopped containers ..." | |
docker rm $(docker ps -qa) |
function changeColorInUri(data, colfrom, colto) { | |
// create fake image to calculate height / width | |
var img = document.createElement("img"); | |
img.src = data; | |
img.style.visibility = "hidden"; | |
document.body.appendChild(img); | |
var canvas = document.createElement("canvas"); | |
canvas.width = img.offsetWidth; | |
canvas.height = img.offsetHeight; |
# Set variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |
// Based on https://github.com/facebook/relay/blob/master/packages/react-relay/modern/ReactRelayQueryRenderer.js | |
/** | |
* Copyright (c) 2013-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* |
const profileInfoViewed = (fromComponent, profile) => { | |
const { id, name, age, homeLocation } = profile; | |
eventsAPI( | |
'ProfileInfoViewed', | |
fromComponent, | |
{ id, name, age, city: homeLocation.title } | |
); | |
}; |
class ProfileName extends React.Component { | |
componentDidMount() { | |
profileInfoViewed('ProfileName', this.props.profile); | |
} | |
render() { | |
return ( | |
<View> | |
<Text>{this.profile.name}</Text> | |
</View> |
const profileInfoViewed = (fromComponent, profile) => { | |
const { id, name, age, homeLocation } = profile; | |
eventsAPI( | |
'ProfileInfoViewed', | |
fromComponent, | |
{ id, name, age, city: homeLocation.title } | |
); | |
}; | |
export const profileInfoViewedFragment = graphql` |