Skip to content

Instantly share code, notes, and snippets.

View kaiohken1982's full-sized avatar

Sergio Rinaudo kaiohken1982

View GitHub Profile
@kaiohken1982
kaiohken1982 / gist:21d94409b8f88128a62f6a6e0c386a7b
Created May 16, 2022 10:05
VSCODE GO plugin config no code fix on save
/**
* In VSCODE l'estensione GO elimina il codice inutilizzato
* al salvataggio, per disattivare questo comportamento,
* modificare settings.json come qui di seguito
*
* File AppData/Roaming/Code/User/settings.json
*/
"[go]": {
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#design_host {
position: absolute;
width: 100%;
height: 100%;
@kaiohken1982
kaiohken1982 / gist:00cceab06b54c89ea4bc
Created October 8, 2014 16:31
Boilerplate html doc
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Il titolo della pagina</title>
<meta name="description" content="La descrizione della pagina">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--/ Facebook Thumb Fixer Open Graph /-->
@kaiohken1982
kaiohken1982 / index.html
Last active August 29, 2015 14:06
Dynamic menu hightlight AngularJS directive
<!-- this is the main inex.html file of the app -->
</head>
<!-- <body ng-app="angularJsphonegapApp"> manual bootstrap within app.js -->
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Add your site or application content here -->
@kaiohken1982
kaiohken1982 / AngularJS service test
Created July 11, 2014 13:41
AngularJS difference between service, factory and provider in a simple script
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="MyCtrl">
{{serviceOutput}}
<br/><br/>
@kaiohken1982
kaiohken1982 / Authorize.php
Created March 14, 2014 21:12
Autologin user on ZF1 example
<?php
/**
* Validatore per l'autorizzazione
*
* @author Sergio Rinaudo
*/
class My_Validate_Authorize extends Zend_Validate_Abstract
{
const NOT_AUTHORISED = 'notAuthorised';
@kaiohken1982
kaiohken1982 / gist:7645060
Created November 25, 2013 17:26
cdcol db xampp
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generato il: Nov 25, 2013 alle 18:23
-- Versione del server: 5.5.27
-- Versione PHP: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@kaiohken1982
kaiohken1982 / gist:7604652
Created November 22, 2013 18:29
bootstrap.php (cli-config)
<?php
// bootstrap.php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
// var_dump(__DIR__); exit;
// Create a simple "default" Doctrine ORM configuration for Annotations
@kaiohken1982
kaiohken1982 / gist:7604627
Created November 22, 2013 18:28
cli-config.php
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
require_once 'bootstrap.php';
return ConsoleRunner::createHelperSet($entityManager);
@kaiohken1982
kaiohken1982 / gist:7419560
Created November 11, 2013 20:12
Zend Framework 1 Acl implementation #4
<?php
class My_Acl_Assert_CleanIPAssertion implements Zend_Acl_Assert_Interface
{
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null,
Zend_Acl_Resource_Interface $resource = null, $privilege = null)
{
return $this->_isCleanIP($_SERVER['REMOTE_ADDR']);
}