Skip to content

Instantly share code, notes, and snippets.

@salipro4ever
salipro4ever / bootstrap.php
Created February 23, 2017 04:02 — forked from vitalyrotari/bootstrap.php
Language support for FuelPHP
/**
* app/bootstrap.php
*/
Autoloader::add_classes(array(
// Add classes you want to override here
// Example: 'View' => APPPATH.'classes/view.php',
'Uri' => APPPATH.'classes/uri.php',
'LayoutHelper' => APPPATH.'classes/layouthelper.php',
));
@salipro4ever
salipro4ever / Parser.php
Created April 13, 2017 06:39
Fuelphp - Allow Lex parser execute with $data
<?php
/**
* Part of the Lex Template Parser.
*
* @author Dan Horrigan
* @license MIT License
* @copyright 2011 - 2012 Dan Horrigan
*/
namespace Lex;
@salipro4ever
salipro4ever / sqlsrv_v1.8
Created April 19, 2017 07:59
FUELPHP - bug sqlsrv
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]'NAMES' is not a recognized SET option.
---------------
'default' => array(
'type' => 'pdo',
'connection' => array(
'dsn' => 'sqlsrv:Server=localhost;Database=HOURGLASS_DEV',
'username' => 'sa',
'password' => '123456'
),
@salipro4ever
salipro4ever / xampp.md
Created August 31, 2017 03:34
Xampp - restore db from other
  1. Install same version (suggest: portable in C:/xampp)
  2. Change same root/password like old
  3. Backup new /mysql/data and paste /data folder to here
  4. Start xampp

----------- ERROR

  1. Table "xxx" doesn't exist -> need copy all /data folder not only database name
@salipro4ever
salipro4ever / jquery
Created October 19, 2017 08:32
Create jquery plugin (faster)
$.fn.digits = function(){
return this.each(function(){
$(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") );
})
}
You could then use it like this:
$("span.numbers").digits();
@salipro4ever
salipro4ever / timezone.json
Created October 31, 2017 03:49
Short timezone
{
"(GMT-11:00) Pago Pago": "Pacific/Pago_Pago",
"(GMT-10:00) Hawaii Time": "Pacific/Honolulu",
"(GMT-08:00) Pacific Time": "America/Los_Angeles",
"(GMT-08:00) Pacific Time - Tijuana": "America/Tijuana",
"(GMT-07:00) Mountain Time": "America/Denver",
"(GMT-07:00) Mountain Time - Arizona": "America/Phoenix",
"(GMT-07:00) Mountain Time - Chihuahua, Mazatlan": "America/Mazatlan",
"(GMT-06:00) Central Time": "America/Chicago",
"(GMT-06:00) Central Time - Mexico City": "America/Mexico_City",
@salipro4ever
salipro4ever / abc-lumen55-jwt-auth
Last active February 7, 2018 04:00
JWT auth for Lumen 5.5 & tymon/jwt-auth
composer.json
...
"require": {
"php": ">=7.0",
"laravel/lumen-framework": "5.5.*",
"vlucas/phpdotenv": "~2.2",
"tymon/jwt-auth": "1.0.0-rc.1"
},
-----------
@salipro4ever
salipro4ever / vue-routes-case-1.js
Last active February 23, 2018 07:56
Two ways to define vue-route
//app.js
import VueRouter from 'vue-router';
import routes from './routes';
Vue.use(VueRouter);
const router = new VueRouter({ mode: 'history', routes: routes});
const app = new Vue({
el: '#app',
router //mandatory similar, because in ES6, {router} ~ {router: router}
});
@salipro4ever
salipro4ever / blogger-template-empty.xml
Created March 19, 2018 02:46
Empty google template
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>
<b:if cond='data:blog.isMobile'>
<meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/>
<b:else/>
<meta content='width=1100' name='viewport'/>
</b:if>
<b:include data='blog' name='all-head-content'/>
@salipro4ever
salipro4ever / blogger-snippets
Last active March 19, 2018 04:48
Blogger Snippets
http://pebblesdog-oddthemes.blogspot.com/
/*<![CDATA[*/
if (typeof firstText == "undefined") firstText = "First";
if (typeof lastText == "undefined") lastText = "Last";
var noPage;
var currentPage;
var currentPageNo;
var postLabel;
pagecurrentg();