Skip to content

Instantly share code, notes, and snippets.

<?php
public function hasValidCert()
{
if (!isset($_SERVER['SSL_CLIENT_M_SERIAL'])
|| !isset($_SERVER['SSL_CLIENT_V_END'])
|| !isset($_SERVER['SSL_CLIENT_VERIFY'])
|| $_SERVER['SSL_CLIENT_VERIFY'] !== 'SUCCESS'
|| !isset($_SERVER['SSL_CLIENT_I_DN'])
) {
return false;
-- ejercicio 2
use LaboSQL_12;
select authors.au_lname, authors.au_fname, titles.title from authors
inner join titleauthor on authors.au_id = titleauthor.au_id
inner join titles on titles.title_id = titleauthor.title_id;
-- ejercicio 3
select * from authors
where state = 'CA' and au_lname not like 'M%';
@dsueiro
dsueiro / cmsblockfix.diff
Created December 15, 2016 00:22 — forked from piotrekkaminski/cmsblockfix.diff
cms block fix
diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php
index bc81de3..a0dce44 100755
--- a/app/code/core/Mage/Cms/Block/Block.php
+++ b/app/code/core/Mage/Cms/Block/Block.php
@@ -72,4 +72,24 @@ protected function _toHtml()
}
return $html;
}
+
+ /**
@dsueiro
dsueiro / gist:4431909
Created January 2, 2013 03:32
Using group_concat in cakephp
var_dump($this->Resolucion->find('all',
array('joins' => array(
array(
'table' => 'resoluciones_palabras_clave',
'type' => 'LEFT',
'conditions' => array('Resolucion.id = resoluciones_palabras_clave.resolucion_id')
@dsueiro
dsueiro / warmly.sh
Created October 5, 2016 20:03 — forked from thomasfr/warmly.sh
A wget based easy poor man`s cache warmer script
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#
@dsueiro
dsueiro / shell.c
Created September 12, 2016 20:02 — forked from parse/shell.c
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@dsueiro
dsueiro / 0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Created July 26, 2016 20:52 — forked from renttek/0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
Bugfix for Zend Framework 1 in Magento (>= 1.7.*.*) + PHP 5.6
From 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <julian.nuss@outlook.com>
Date: Tue, 23 Sep 2014 21:07:29 +0200
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6
---
lib/Zend/Locale/Format.php | 22 +++++++++++-----------
lib/Zend/Service/Audioscrobbler.php | 6 +++---
lib/Zend/Service/Technorati.php | 6 +++---
lib/Zend/Validate/Hostname.php | 4 ++--
@dsueiro
dsueiro / clean_magento.sql
Created December 30, 2015 12:08
Deletes all user generated data in Magento
-- DELETE ALL PRODUCTS
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
@dsueiro
dsueiro / gist:5406417
Created April 17, 2013 18:02 — forked from anonymous/gist:3842009
Every prepareCollection
File: Adminhtml/Block/Api/Grid/Role.php
function _prepareCollection()
{
$collection = Mage::getModel("api/roles")->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
+--------------------------------------------------+
File: Adminhtml/Block/Api/Role/Grid/User.php

This is a review of "Quantitative Analysis of the Full Bitcoin Transaction Graph" by Dorit Ron and Adi Shamir.

There are some incorrect details and analyses that warrant attention.

Oct. 31 UPDATE

The authors have introduced several revisions to their paper, available at the same URL as before.

The criticism below may be outdated in part or in full.