Skip to content

Instantly share code, notes, and snippets.

@vicnicius
vicnicius / gist:8685656
Created January 29, 2014 10:50
Script for optimizing all .png images inside a folder, using optipng
find the-path-you-want/* -type f -name *.png | xargs optipng *.png
@vicnicius
vicnicius / gist:8685678
Created January 29, 2014 10:52
Script for optimizing all .jpg images inside a folder, using jpegoptim
find ~/path-to-your-folder/* -type f -name *.jpg | xargs jpegoptom --all-progressive *.jpg
@vicnicius
vicnicius / ES5 style
Created July 26, 2014 14:18
Prototypal Javascript
function Animal(name){
this.name = name;
}
Animal.prototype.getName = function(){
return this.name;
}
function Dog(name){
Animal.call(this, name);
@vicnicius
vicnicius / gist:79d050a39616812a530c
Last active August 29, 2015 14:05
Change Permissions Recursively
find /opt/lampp/htdocs -type d -exec chmod 755 {} \;
find /opt/lampp/htdocs -type f -exec chmod 644 {} \;
@vicnicius
vicnicius / gist:ff24e1dde77c339277c1
Created September 5, 2014 04:35
Port Forward - The old way
sudo ipfw add 100 fwd 127.0.0.1,80 tcp from any to any 8080 in
@vicnicius
vicnicius / portForwading.txt
Last active September 9, 2015 18:05
Mac OSX Port Forwading
sudo ifconfig lo0 alias 10.0.0.1 && echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 3000" | sudo pfctl -ef -
@vicnicius
vicnicius / pr.md
Created September 29, 2015 22:10 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@vicnicius
vicnicius / portkiller.sh
Created April 22, 2016 12:43
Kill's the process running on specific port
fuser -k 8080/tcp

Keybase proof

I hereby claim:

  • I am vicnicius on github.
  • I am vicnicius (https://keybase.io/vicnicius) on keybase.
  • I have a public key ASCDEtSYb5ByT6MbDO8mOo2I1S7hUcWnNjfayr78dK2_qQo

To claim this, I am signing this object: