Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar

Tiago Celestino tcelestino

View GitHub Profile
@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
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@tcelestino
tcelestino / .jscsrc
Created October 29, 2014 16:24
config jscs to sublime linter
{
"requireCurlyBraces": true,
"requireSpaceAfterKeywords": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},