git pull "http://[user]:[password]@bitbucket.org/[user]/[repo].git" master
hasta!
git pull "http://[user]:[password]@bitbucket.org/[user]/[repo].git" master
mysqldump -u USER -p --opt --quote-names --skip-set-charset --default-character-set=latin1 DBNAME > dump.sql
mysql -u USER -p --default-character-set=utf8 DBNAME < dump.sql
aptitude search apache2 aptitude install apache2 ps aux | grep apache sudo aptitude install libapache2-mod-wsgi sudo service apache2 restart
apt-get install python-virtualenv
apt-get update apt-get install mysql-client-core-5.5 apt-get install mysql-server mysql -u root -p ps aux | grep mysql
apt-get update aptitude install php5 libapache2-mod-php5 /etc/init.d/apache2 restart mysql -u root -p ps aux | grep mysql
apt-get install git ssh-keygen
virtualenv --no-site-packages --unzip-setuptools ENV pip install django
... <input type="file" name="imagem_upload" id="id_foto"> <div id="img2"></div> ...
#img2 {
width: 80px; height: 80px;
background: url(imagem-padrao.jpg) no-repeat center center;
background-size: cover;
position: absolute;
top: 50%; left: 50%;
margin-left: -40px;
margin-top: -40px;
border-radius: 50%;
border: 5px solid #fff;
z-index: 1;
}
$('#id_foto').live('change', function(){
var input = document.getElementById("id_foto");
var fReader = new FileReader();
fReader.readAsDataURL(input.files[0]);
fReader.onloadend = function(event){
$("#img2").css('background', 'url('+event.target.result+') no-repeat center center');
$("#img2").css('background-size', 'cover');
}
});
sudo nano /etc/apache2/httpd.conf
DocumentRoot "/Users/myusername/Sites" <Directory "/Users/myusername/Sites"> Options Indexes FollowSymLinks Multiviews MultiviewsMatch Any AllowOverride All </Directory>
sudo apachectl restart
function UpdateQueryString(key, value, url) {
if (!url) url = window.location.href;
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi");
if (re.test(url)) {
if (typeof value !== 'undefined' && value !== null)
return url.replace(re, '$1' + key + "=" + value + '$2$3');
else {
var hash = url.split('#');
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
url += '#' + hash[1];
return url;
}
}
else {
if (typeof value !== 'undefined' && value !== null) {
var separator = url.indexOf('?') !== -1 ? '&' : '?',
hash = url.split('#');
url = hash[0] + separator + key + '=' + value;
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
url += '#' + hash[1];
return url;
}
else
return url;
}
}
location.href = UpdateQueryString('seu_parametro',SEU_VALOR);
$('.fb-share').click(function(event) {
/* Act on the event */
var app_id = 'SUA_APP_ID_AQUI'
var title = "SEU TITULO AQUI";
var summary = "SUA DESCRICAO AQUI";
var link = "http://www.LINK-DO-SEU-SITE-AQUI.com.br/";
var image = link+"CAMINHO/DA/IMAGEM.png";
var caption = "ASSINATURA DO SITE AQUI"
var fb_share = 'https://www.facebook.com/dialog/feed?'+
'app_id='+app_id+'&'+
'link='+link+'&'+
'picture='+image+'&'+
'name='+title+'&'+
'caption='+caption +'&'+
'description='+summary+'&'+
'redirect_uri='+link;
window.open(fb_share);
});
function isScrolledIntoView(elem)
{
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;
var elemBottom = elemTop + $(elem).height();
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}
Outra solução seria alterar o elemBottom para desconsiderar a altura e tratar o início da exibição do elemento em tela.
file -bi arquivo.txt ou
file -i arquivo.txt
$('< img / >').attr('src', '/static/site/css/img/SUA_IMAGEM.png').load(function() {
$('div.bg').css('background-image', 'url(/static/site/css/img/SUA_IMAGEM.png)');
$('div.bg').show();
// o que mais tiver que fazer
});
::-webkit-input-placeholder { /* WebKit browsers */
color: #999; opacity:1; filter:alpha(opacity=100);
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #999; opacity:1; filter:alpha(opacity=100);
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #999; opacity:1; filter:alpha(opacity=100);
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #999; opacity:1; filter:alpha(opacity=100);
}
<?php
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: maxage=".$cache_expire);
header('Expires: '.gmdate('D, d M Y H:i:s', time()+$cache_expire).' GMT');
?>
<script src="//connect.facebook.net/en_US/all.js"></script>
Se não tiver trabalhando com php, pode criar um arquivo apenas com o script do facebook, o php acima serve apenas para controle de cache, ou pode fazer da forma que sua linguagem assim permitir.<meta property="og:title" content="TITULO" /> <meta property="og:url" content="<?=$url?>/" /> <meta property="og:type" content="company" /> <meta property="og:site_name" content="TITULO DO SITE" /> <meta property="og:description" content="DESCRICAO" /> <meta property="fb:app_id" content="ID DO APLICATIVO" /> <meta property="og:image" content="https://URL DA THUMB/thumb.jpg" />
<!-- Facebook JS SDK -->
<div id="fb-root"></div>
<script>
// Additional JS functions here
window.fbAsyncInit = function() {
FB.init({
appId : 'ID DO APLICATIVO', // App ID
channelUrl : '//CHANNEL FILE', // Channel File ex: 'SEU SITE/channel.php'
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional init code here
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// connected
//alert('usuario já autorizou a aplicacao');
//console.log(JSON.stringify(response));
FB.api('/me', function(response){
//DADOS ESTARÃO TODOS NO RESPONSE
// Ex:
// NOME = response.name
});
} else if (response.status === 'not_authorized') {
// not_authorized
login();
} else {
// not_logged_in
login();
}
});
};
function login() {
FB.login(function(response) {
if (response.authResponse) {
// connected
FB.api('/me', function(response) {
location.reload();
});
} else {
// cancelled
//alert("Usuário Cancelou");
}
},{scope: 'email'});
}
function postToWall() {
FB.login(function(response) {
if (response.authResponse) {
FB.ui({
method: 'feed',
name: 'NOME',
link: 'LINK DO SEU APLICATIVO', // EX: https://www.facebook.com/SUA PAGINA/app_(ID DO APLICATIVO)';
picture: 'URL DA FOTO DO POST',
caption: 'LEGENDA',
description: 'DESCRICAO/TEXTO DO POST'
},
function(response) {
if (response && response.post_id) {
//alert('Post was published.');
} else {
//alert('Post was not published.');
}
});
} else {
//alert('User cancelled login or did not fully authorize.');
}
}, {scope: 'publish_stream'});
return false;
}
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
/* Mascaras pre-existentes*/
/*$.mask.masks : {
'phone' : { mask : '(99) 9999-9999' },
'phone-us' : { mask : '(999) 9999-9999' },
'cpf' : { mask : '999.999.999-99' },
'cnpj' : { mask : '99.999.999/9999-99' },
'date' : { mask : '39/19/9999' }, //uk date
'date-us' : { mask : '19/39/9999' },
'cep' : { mask : '99999-999' },
'time' : { mask : '29:69' },
'cc' : { mask : '9999 9999 9999 9999' }, //credit card mask
'integer' : { mask : '999.999.999.999', type : 'reverse' },
'decimal' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue: '000' },
'decimal-us' : { mask : '99.999,999,999,999', type : 'reverse', defaultValue: '000' },
'signed-decimal' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue : '+000' },
'signed-decimal-us' : { mask : '99,999.999.999.999', type : 'reverse', defaultValue : '+000' }
}
*/
/* Mascaras personalizadas */
$.mask.masks = $.extend($.mask.masks,{
msk:{ mask: '999-999' },
other_msk:{ mask: '6666' },
another_one:{ mask: '7777' , type:'reverse' },
dose:{ mask: '99'},
termina_em:{ mask: '39/19/9999', autoTab:false },
phone_9digito:{ mask: '(99) 99999-9999'}
});
(function($){
$(function(){
$('input:text').setMask();
var ddds = ['11) 9','12) 9','13) 9','14) 9','15) 9','16) 9','17) 9','18) 9','19) 9','21) 9','22) 9','24) 9','27) 9','28) 9'];
// SP 11 - 19
// RJ 21,22,24
// ES 27,28
$('#id_telefone, #id_celular, #id_celular_validacao, #id_telefone').keydown(function(event) {
if( procura_no_array($(this).val().substring(1,6), ddds) >= 0){
$(this).attr('alt','phone_sp');
}else{
$(this).attr('alt','phone');
}
$(this).setMask();
});
});
})(jQuery);
<input alt="phone_9digito" class="input2" id="id_telefone" name="telefone" placeholder="Telefone" type="text" value="" />