This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thePlayer = new YT.Player('yt-embed', { | |
height: '360', | |
width: '540', | |
videoId: 'bScJ8bbwMNM', | |
events: { | |
'onStateChange': function(e){ | |
switch (e.data) { | |
case YT.PlayerState.ENDED: | |
clearWatcherVideo(); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin placeholder() { | |
&::-webkit-input-placeholder { | |
@content; | |
} | |
&:-moz-placeholder { | |
@content; | |
} | |
&::-moz-placeholder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{"keys": ["super+shift+h"], "command": "encode_html_entities"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkCPF( val ) { | |
val = $.trim(val); | |
val = val.replace('.',''); | |
val = val.replace('.',''); | |
cpf = val.replace('-',''); | |
while(cpf.length < 11) cpf = "0"+ cpf; | |
var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/; | |
var a = []; | |
var b = new Number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# limpa a pasta antiga | |
rm -rf ~/Sites/apache-tomcat-6.0.37/work/Catalina/localhost/ | |
FOLDER=$(pwd) | |
LocalHostFolder="~/Sites/apache-tomcat-6.0.37/conf/Catalina/localhost/" | |
ROOTFile=$LocalHostFolder"ROOT.xml" | |
XMLTemplate="<Context docBase=\"$FOLDER/web\" path=\"\"> | |
</Context>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery.preload | |
* | |
* Preload images using the promise pattern. | |
* | |
* Usage: | |
* | |
* $.preload(img_uri, img_uri, ...).done(function(img, img, ...) { | |
* // Do stuff with the arguments | |
* }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
date=`date "+%Y-%m-%dT%H_%M_%S"` | |
HOME=/Users/path | |
rsync -azP \ | |
--delete \ | |
--delete-excluded \ | |
--exclude-from=$HOME/.Trash \ | |
--exclude-from=$HOME/.cache \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind to change the function scope and send arguments for the functions | |
Function.prototype.bind = function(context) { | |
var __method = this, | |
args = Array.prototype.slice.call(arguments, 1); | |
return function() { | |
var a = Array.prototype.concat(Array.prototype.slice.call(arguments), args); | |
return __method.apply(context, Array.prototype.slice.call(a)); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir /var/mysql | |
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function linearSearch(values, target) { | |
for(var i = 0; i < values.length; ++i){ | |
if (values[i] == target) { return i; } | |
} | |
return -1; | |
} |
OlderNewer