Skip to content

Instantly share code, notes, and snippets.

@bytefade
bytefade / random.js
Created December 21, 2016 19:40 — forked from luanrm/random.js
var cores = [
"#F44336",
"#E91E63",
"#9C27B0",
"#673AB7",
"#3F51B5",
"#2196F3",
"#03A9F4",
"#00BCD4",
"#009688",
@bytefade
bytefade / index.html
Last active December 22, 2016 00:16 — forked from luanrm/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<p class="esg-click-to-play-video">Teste</p>
<p class="esg-click-to-play-video">Teste</p>
@bytefade
bytefade / cores.txt
Created December 21, 2016 18:26
Cores
#F44336
#E91E63
#9C27B0
#673AB7
#3F51B5
#2196F3
#03A9F4
#00BCD4
#009688
#4CAF50
@bytefade
bytefade / ativar_popup_wp.php
Last active November 17, 2016 21:38
Ativar popup usando wordpress e magnifig popup
<!-- Ativar popup -->
<script type="text/javascript">
<?php global $wp, $post;
$current_url = home_url(add_query_arg(array(),$wp->request));
// $current_url = home_url();
$meta_popup = get_post_meta($post->ID, 'popupsite', true);
?>
//sim: liga popup nao ou '' desliga popup
@bytefade
bytefade / .env.example
Created October 21, 2016 23:55
Wordpress .env example
WP_DEBUG=false
DB_TABLE_PREFIX=wp_
DB_NAME=wordpress
DB_USER=root
DB_PASSWORD=root
DB_HOST=localhost
AUTH_KEY='put your unique phrase here'
LOGGED_IN_KEY='put your unique phrase here'
@bytefade
bytefade / wp-config.php
Created October 21, 2016 23:55
Wordpress wp-config, style Dotenv
<?php
require_once(__DIR__ . '/vendor/autoload.php');
(new \Dotenv\Dotenv(__DIR__))->load();
define('WP_DEBUG', getenv('WP_DEBUG'));
$table_prefix = getenv('DB_TABLE_PREFIX');
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
@bytefade
bytefade / number_format_alternative.php
Created April 13, 2016 17:21
number_format_alternative
<?php
echo number_format(substr("11990", 0, -2),0,"",".").','.substr("11990", -2);
@bytefade
bytefade / foreach.php
Last active April 13, 2016 13:31
Foreach php array
<?php
$params = ['id' => 0];
try {
$api = new Gerencianet($options);
$subscription = $api->detailSubscription($params, []);
// var_dump($subscription); die;
foreach ($subscription as $value) {
// Array simples
@bytefade
bytefade / phpkey
Created March 1, 2016 14:33
Colocar no .bashrc
alias phpkey='php -r "echo md5(uniqid()).\"\n\";"'
@bytefade
bytefade / 0_reuse_code.js
Created February 12, 2016 11:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console