Skip to content

Instantly share code, notes, and snippets.

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) " ";
}

USA =
{'name': 'data', 'children': [
{'name':'A', 'desc':"Communicable, maternal, perinatal and nutritional conditions", 'children':[
{'name':'A01', 'desc':"Tuberculosis", '90FE':0, '90FL':0, '90FP':.000484, '90F1':.000857, '90F5':.000954, '90F10':.000915, '90F15':.000679, '90F20':.001865, '90F25':.002201, '90F30':.002423, '90F35':.001872, '90F40':.001363, '90F45':.001124, '90F50':.000934, '90F55':.000866, '90F60':.000818, '90F65':.000846, '90F70':.00086, '90F75':.000809, '90F80':.000549, '00FE':0, '00FL':0, '00FP':.000539, '00F1':.001017, '00F5':.000981, '00F10':.000816, '00F15':.000609, '00F20':.001216, '00F25':.001175, '00F30':.001267, '00F35':.000935, '00F40':.000713, '00F45':.000735, '00F50':.000596, '00F55':.000584, '00F60':.000544, '00F65':.000565, '00F70':.000608, '00F75':.000603, '00F80':.000399},
{'name':'A02', 'desc':"HIV/AIDS", '90FE':.023124, '90FL':.002457, '90FP':.023525, '90F1':.098902, '90F5':.103213, '90F10':.06633, '90F15':.078107, '90F20':.142801, '90F25':.114696, '90F30':.122893, '90F35'
@r-sal
r-sal / Windows8Notes.md
Last active December 13, 2015 17:48
Windows 8 Notes

Windows 8 Notes


Opening Startup Folder

Windows + R -> %AppData%\Microsoft\Windows\Start Menu\Programs\Startup

Useful Shortcuts

hibernate - C:\Windows\System32\rundll32.exe PowrProf.dll,SetSuspendState

@r-sal
r-sal / essentialUnixCommands.md
Last active December 13, 2015 18:09
Most Important UNIX commands