Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar
🙃

Tiago Celestino tcelestino

🙃
View GitHub Profile
@tcelestino
tcelestino / detect-global.js
Created July 28, 2015 12:03
Detecting var globals. Create by Remy Sharp
(function (global) {
function Globals () {}
var getWindow = function () {
var iframe = document.createElement('iframe')
iframe.style.display = 'none'
document.body.appendChild(iframe)
var result = iframe.contentWindow || iframe.contentDocument
@tcelestino
tcelestino / tplSettings.md
Last active August 29, 2015 14:25 — forked from dre3s/my.js.underscore.tpl.settings.md
UnderscoreJs - Template Settings

UnderscoreJs - Template Settings

  var templateHtml = this.$el.html(),                                                                              |      <span class="item-duration">{{= item.duration }}</p>                                  
  content = {                                                                                                      |      </a>                                                                                  
    item: this.item.attributes                                                                                     |      <div class="item-info">                                                               
  },                                                                                                               |        <p class="item-sectionName">                                                        
  tplSetting = {                                                                                                   |          <a href="{{= item.se
@tcelestino
tcelestino / wp-config.php
Created June 9, 2015 13:58
wp-config.php
<?php
// disable post revision
define('WP_POST_REVISIONS', false );
// change filesystem method
define('FS_METHOD', 'direct');
// disable edit themes and plugins
define('DISALLOW_FILE_EDIT',true);
@tcelestino
tcelestino / .htaccess
Last active August 29, 2015 14:22
tips for .htaccess
# remove www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^meusite.com$ [NC]
RewriteRule ^(.*)$ http://meusite.com/$1 [L,R=301]
# add hotlinking
RewriteEngine On
#Replace ?mysite.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+.)?meusite.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
@tcelestino
tcelestino / countries.json
Last active August 29, 2015 14:21
backbone-example
panCallback(
{
countries: [
{
"EUA": {
"position": 1,
"summary":
{
"gold": 9,
"silver": 15,
var Loader = React.createClass({displayName: "Loader",
render: function () {
var load = {
txt: 'Aguarde, carregando informações...',
ajaxIcon: OPTIONS.ajaxLoaderIconSrc
};
return (
React.createElement("div", {className: "autostats-loader"},
React.createElement("img", {src: load.ajaxIcon}), " ", React.createElement("span", {className: "footstats-font-bold"}, load.txt)
)
@tcelestino
tcelestino / index.html
Last active August 29, 2015 14:19
web notification api
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Notification API</title>
</head>
<body>
<script>
var Notify = (function (window, $) {
var app = {
@tcelestino
tcelestino / gist:76f3b27e8606bcbc557d
Created February 10, 2015 01:10
convert .wav file to .mp3
ffmpeg -i song.wav song.mp3
@tcelestino
tcelestino / breakpoint-media-queries.css
Created November 24, 2014 20:40
breakpoints media queries
/*
0480
*/
@media only screen and (min-width : 320px) and (max-width : 660px){}
/*
0780
*/
@media only screen and (min-width : 661px) and (max-width : 860px) {}
@tcelestino
tcelestino / mysql-pass.txt
Created November 12, 2014 00:45
set password mysql mac os
cd /usr/local/mysql/bin/
./mysql -u root -p
> Enter password: [type old password invisibly]
use mysql;
update user set password=PASSWORD("NEW_PASSWORD_HERE") where User='root';
flush privileges;
quit