Skip to content

Instantly share code, notes, and snippets.

Marcos Matamala Fernández asterion

Block or report user

Report or block asterion

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View a.css
*{margin:0;background:#5d3a3a}div{width:50%;height:200px;background:#b5e0ba}
View php
public function add_instagram_profile(){
$filename = sprintf('/tmp/profile.clapesuc.%s.json', date('Ymd'));
if (file_exists($filename)) {
$json = json_decode(file_get_contents($filename));
} else {
$url = 'https://api.instagram.com/v1/users/'.$this->instagram_uid.'?access_token='.$this->instagram_token;
$text = file_get_contents($url);
$json = json_decode($text);
@asterion
asterion / tiendas.txt
Last active Apr 26, 2018
Listado de tiendas online con productos relacionados a arduino/raspberry
View tiendas.txt
http://cycom.cl/
http://electronicadelsurltda.cl/
http://kowka.cl/
http://rambal.com/
http://www.electronica.cl/productos/
http://www.hmtechtronic.cl/
http://www.hubot.cl/
http://www.maxelectronica.cl/
http://www.mcielectronics.cl/
http://www.mundoreballing.cl/
View groupby.sql
SELECT facturas.id, SUM(detalle.cantidad*detalle.valor) FROM facturas, detalle WHERE facturas.id = detalle.factura_id GROUP BY facturas.id
View query_string.html
<link rel="stylesheet" type="text/css" href="mystyle.css?v=100">
@asterion
asterion / functions.php
Created Oct 30, 2017
upload svg wordpress
View functions.php
<?php
/* codigo ... */
function svg_mime_type($mime_types){
$mime_types['svg'] = 'image/svg+xml';
return $mime_types;
}
add_filter('upload_mimes', 'svg_mime_type', 1, 1);
@asterion
asterion / conn.php
Last active Oct 18, 2017
test_conn_sqlserver
View conn.php
<?php
$conn = new PDO("dblib:version=8.0;charset=UTF-8;host=IPSERVIDOR;dbname=NOMBREDB", 'USUARIO', 'PASSWORD');
$id = rand();
$query = "INSERT INTO Emp VALUES(" . $id .", 'Smith " . $id . "', 'Carpintero', 2, 300)";
$conn->query($query)->execute();
@asterion
asterion / query.php
Created Jul 24, 2017
prueba query_posts
View query.php
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
// The Query
query_posts( 'posts_per_page=3&paged=' . $paged );
// The Loop
while ( have_posts() ) : the_post();
echo '
@asterion
asterion / permiso_wp.php
Last active Jul 7, 2017
otorgar permiso de subir multimedia
View permiso_wp.php
<?php
function allow_contrib_upload() {
$contrib = get_role( 'contributor' );
$contrib->add_cap( 'upload_files' );
}
add_action( 'admin_init', 'allow_contrib_upload', 11 );
View group_max.sql
SELECT nombre, apellido, MIN(edad) AS edad FROM personas GROUP BY nombre, apellido
You can’t perform that action at this time.