Skip to content

Instantly share code, notes, and snippets.

View helielson's full-sized avatar

Helielson helielson

  • Indaband, Frontend Bahia
  • Salvador, Brazil
View GitHub Profile
@helielson
helielson / bash_replace.sh
Last active August 29, 2015 14:08
Bash replace
find . -name "*.extension" | xargs -I{} perl -pi -e 's/old-name/new-name/g' {}
@helielson
helielson / README.md
Last active August 29, 2015 14:10 — forked from addyosmani/README.md

CSS Layout Debugger

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

#!/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)
@helielson
helielson / base64-images-color-replace.js
Last active October 20, 2016 20:00
Replaces a color in a base 64-encoded image
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;
@helielson
helielson / .bashrc
Created March 23, 2017 18:59 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# 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`