Skip to content

Instantly share code, notes, and snippets.

View grekodev's full-sized avatar
🎯
<grekodev/>

Greck Pastor grekodev

🎯
<grekodev/>
View GitHub Profile
@grekodev
grekodev / ticket-php1.php
Created November 6, 2019 16:37 — forked from evilnapsis/ticket-php1.php
Formato de ticket para impresora de ticket
<?php
include "fpdf/fpdf.php";
$pdf = new FPDF($orientation='P',$unit='mm', array(45,350));
$pdf->AddPage();
$pdf->SetFont('Arial','B',8); //Letra Arial, negrita (Bold), tam. 20
$textypos = 5;
$pdf->setY(2);
$pdf->setX(2);
$pdf->Cell(5,$textypos,"NOMBRE DE LA EMPRESA");
@grekodev
grekodev / NumeroALetras.js
Created March 28, 2019 16:27 — forked from alfchee/NumeroALetras.js
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@grekodev
grekodev / gist:d8a739fd6b964b9e73d5b9b8cbbfc319
Created June 18, 2018 17:36 — forked from belsrc/gist:672b75d1f89a9a5c192c
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@grekodev
grekodev / cors.md
Created November 12, 2017 01:39 — forked from jesperorb/cors.md
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@grekodev
grekodev / web-servers.md
Created October 27, 2017 13:38 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@grekodev
grekodev / phalconphp_php7_ubuntu_16_04.sh
Created August 16, 2017 17:27 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
@grekodev
grekodev / php-install.sh
Created April 7, 2017 16:07
PHP 5.6.5 installer for Debian 7.7
#!/bin/sh
apt-get build-dep -y php5-cli
aptitude install -y build-essential git libreadline-dev libxml2-dev libmcrypt-dev libjpeg8-dev libpng12-dev libcurl4-openssl-dev libtidy-dev libxslt1-dev
cd /tmp
git clone git://github.com/CHH/php-build
cd php-build/
./install.sh
mkdir /usr/local/php
php-build -i production 5.6.5 /usr/local/php/5.6.5
cd /usr/local/bin
@grekodev
grekodev / pycharm-install
Last active September 10, 2015 15:02 — forked from shafi-codez/pycharm-install
Pycharm installation
yum install java-1.7.0-openjdk-devel
gunzip pycharm-community-3.1.1.tar.gz
tar -xvf pycharm-community-3.1.1.tar
mv pycharm-community-3.1.1 pycharm-3.1
export JAVA_HOME=/usr
# Pycharm looks with bin/java
vi ~/.bashrc