Skip to content

Instantly share code, notes, and snippets.

@manviny
manviny / smtp_email.php
Last active August 29, 2015 14:16
smtp email
<?php
require("class.phpmailer.php");
//SMTP Settings
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Port = "25";
<!DOCTYPE html>
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="es">
<!--<![endif]-->
<head>
<link href="<?php echo $config->urls->templates?>css/responsive-calendar.css" rel="stylesheet">
</head>
@manviny
manviny / eventos_posteriores.php
Created March 6, 2015 09:28
PW elementos posteriores a una fecha determinda
<?php
$dt = new DateTime(); $ahora = $dt->format('Y-m-d H:i')
$page->children("blog_fecha>=$ahora")->toJSON();
?>;
@manviny
manviny / while
Created March 5, 2015 16:10
bucle while en PHP
<?php
$var = 0;
while ($var>10){
echo "Hola";
$var++;
}
@manviny
manviny / simple_email.php
Last active August 29, 2015 14:16
email classic way
// classic way
function email_classic($from, $from_name, $to, $to_name, $subject, $message){
$from = $from_name. "<".$from.">\n";
$headers = "From: {$from}". "\n";
$headers .= "Reply-To: {$from}". "\n";
$headers .= "Cc: {$to}\n";
$headers .= "Bcc: {$to}\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n";
@manviny
manviny / calcbootstrap
Created February 24, 2015 18:53
calculadora bootstrap
<!DOCTYPE html>
<html>
<head>
<title>Maciej Mensfeld - Calculator</title>
<link rel="stylesheet" href="./assets/stylesheets/bootstrap.min.css" />
<link rel="stylesheet" href="./assets/stylesheets/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="./assets/stylesheets/application.css" />
<script src="./assets/javascripts/jquery-1.9.1.js"></script>
@manviny
manviny / calculadora
Created February 24, 2015 18:51
calculadora html
<html>
<head>
<title>Html calculator</title>
</head>
<body>
<form name="calculator" >
Solution<input type="textfield" name="ans" value="">
<br>
<input type="button" value="1" onClick="document.calculator.ans.value+='1'">
<input type="button" value="2" onClick="document.calculator.ans.value+='2'">
@manviny
manviny / PwAngular.module
Last active January 23, 2016 03:02
Processwire module to add angularjs to all pages
<?php
/**
* ProcessWire 'Hello world' demonstration module
*
* Demonstrates the Module interface and how to add hooks.
*
* See README file for further links regarding module development.
*
* ProcessWire 2.x
@manviny
manviny / app.js
Last active August 29, 2015 14:07 — forked from auser/app.js
angular.module('myApp',
['ngRoute', 'myApp.services', 'myApp.directives']
)
.config(function(AWSServiceProvider) {
AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role');
})
.config(function(StripeServiceProvider) {
StripeServiceProvider.setPublishableKey('pk_test_YOURKEY');
})
.config(function($routeProvider) {
<?php
//enlace el SDK de Facebook, junto con los datos del APP(ID y secret)
require_once('src/facebook.php');
$facebook = new Facebook(array(
"appId"=>"768300403189668",
"secret"=>"b56fd624f2fba94c4eb54fdb2954a2bd"
));
//creacion de variables con los datos de la noticia sacados de processwire