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 / 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;
#!/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)
#!/bin/bash
PWD=$(pwd)
GIT_ROOT=~/workspace
CYAN='\033[36m'
GREEN='\033[32m'
NC='\033[0m' # No Color
cd $GIT_ROOT > /dev/null
@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

@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' {}
all_user_agents = [
'Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)',
'Mozilla/5.0 (compatible; ABrowse 0.4; Syllable)',
'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser 1.98.744; .NET CLR 3.5.30729)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; GTB5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; Maxthon; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Acoo Browser; GTB5;',
'Mozilla/4.0 (compatible; Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727); Windows NT 5.1; Trident/4.0; Maxthon; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.2)',
'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Acoo Browser; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30618)',
'Mozilla/4.0 (compatible; MSIE
Vagrant.configure("2") do |config|
config.vm.define "app" do |app|
app.vm.provider "docker" do |d|
d.build_dir = "."
d.cmd = ["echo", "hello"]
end
end
end
@helielson
helielson / publish.py
Created August 14, 2013 21:11
Pub/Sub example with ZeroMQ
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://127.0.0.1:6000")
while True:
socket.send("Msg")
time.sleep(1)
{
"menu": {
"home": [
{
"label": "title1",
"iconClass": "icon1"
},
{
"label": "title2",
"iconClass": "icon2"
# Note: You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to run some shortcuts.
# ------------------------------------------------------------------------------
#
# NPM
#
# ------------------------------------------------------------------------------
# Install Bower
function nb() {
npm install -g bower