Skip to content

Instantly share code, notes, and snippets.

View junioryauricasa's full-sized avatar
:octocat:
Focusing

elShunior junioryauricasa

:octocat:
Focusing
View GitHub Profile
@r-sal
r-sal / PHPExcel_Basics.md
Last active May 8, 2024 06:29
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

<?php
$username="root"; $password=""; $database="exam_codes";
$con = mysql_connect("localhost",$username,$password) or die( "Unable to Connect database");
mysql_select_db($database,$con) or die( "Unable to select database");
// Table Name that you want
// to export in csv
$ShowTable = "blogs";
$FileName = "_export.csv";
$file = fopen($FileName,"w");
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000
<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
echo $user_agent;
function getBrowser($user_agent){
if(strpos($user_agent, 'Maxthon') !== FALSE)
return "Maxthon";
elseif(strpos($user_agent, 'SeaMonkey') !== FALSE)
return "SeaMonkey";
elseif(strpos($user_agent, 'Vivaldi') !== FALSE)
return "Vivaldi";
@theredstapler
theredstapler / gendocx.php
Last active December 19, 2017 19:15
Source code of PHPWord Tutorial by Red Stapler. View Tutorial at: https://redstapler.co/tutorials/phpword-intro/
<?php
require_once 'vendor/autoload.php';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $_POST['htmlstring']);
$fancyTableStyleName = 'Fancy Table';
$fancyTableStyle = array('borderSize' => 1, 'borderColor' => 'd2d2d2', 'cellMargin' => 40, 'alignment' => \PhpOffice\PhpWord\SimpleType\JcTable::CENTER);
@cprakashagr
cprakashagr / LICENCE SUBLIME TEXT
Last active June 24, 2024 20:13
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA