Skip to content

Instantly share code, notes, and snippets.

@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 Snippets

Switching between \n and

define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
echo date('H:i:s') , " Load from Excel5 template" , EOL;

@r-sal
r-sal / PHPWord_snippets.md
Created December 18, 2012 02:39
PHPWord Snippets

PHPWord Snippets

// New Word Document
$PHPWord = new PHPWord();

// New portrait section
$section = $PHPWord-&gt;createSection();
@r-sal
r-sal / gfm.rb
Created December 20, 2012 10:53 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
@r-sal
r-sal / GitNotes.md
Last active December 11, 2015 04:58

GitHub


[Git Documentation](http://git-scm.com/doc)

The basic Git workflow goes something like this:

  1. You modify files in your working directory.
  2. You stage the files, adding snapshots of them to your staging area.
  3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.

@r-sal
r-sal / CSSSnippets.md
Last active December 11, 2015 05:19
Small collection of various code snippets

Display an HTML attribute value in CSS with attr()
To display the data-prefix attribute of an

heading

<h3 data-prefix="Custom prefix">This is a heading</h3>
h3:before {
  content: attr(data-prefix) " ";
}