Skip to content

Instantly share code, notes, and snippets.

View asathoor's full-sized avatar
:octocat:
Words! Words! Words! (Shakespeare)

Per Thykjaer Jensen (PETJ) asathoor

:octocat:
Words! Words! Words! (Shakespeare)
View GitHub Profile
SQL - my collection
===================
## CREATE TABLE
CREATE TABLE my_table
(
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(50),
@asathoor
asathoor / gist:c0fa01d8ae7a9ead9e87
Last active August 29, 2015 14:17
Images in a WordPress theme or child theme - several methods
<!-- in case of problems with displaying the images chmod 777 and chown daemon:daemon -->
<!-- link to media files -->
<p>
<img src="http://localhost/test/wordpress/wp-content/uploads/2015/03/cropped-download-1.jpg" width="200" height="*">
<p>
<!-- image in the template folder -->
<p>
<img src="<?php bloginfo('stylesheet_directory');?>/images/car.jpg"/ >
</p>
@asathoor
asathoor / pandocslidy
Created May 21, 2015 10:26
Pandoc slidy slideshow
pandoc -t slidy -s -H _css fowd-laerermoede.md -o index.html
@asathoor
asathoor / gist:e7a517281f30097320bc
Created May 21, 2015 16:07
Pandoc markdown with bibliography
### Pandoc terminal command
pandoc template.md --bibliography=books.bib -o test.html
### How to quote
Write something like this: [@bruceLee] or [-@bruceLee] (the last if you don't want to see the author name).
@asathoor
asathoor / gist:75a2df2a7bc61b693f13
Created May 22, 2015 14:03
Write to the beginning of a textfile in php
<?php
// add to top op a file
$file_data = "Lorem ipsum sit dolor...\n";
$file_data .= file_get_contents('text.txt');
file_put_contents('text.txt', $file_data);
?>
@asathoor
asathoor / gist:58f41f8e6a3f17f65ff3
Created May 24, 2015 04:28
Read a textfile, explode to array ...
<?php
class AQCreader {
function AQCPostsNumberOf() {
$laes = file_get_contents('AQC-Index-2010.txt');
$AQCarray = explode("\n", $laes);
echo (count( $AQCarray ) + 1); // number of lines in file
}
}
?>
<?php
/* Count: 001 002 003 */
$invID = 11; // sample
$invID = str_pad($invID, 3, '0', STR_PAD_LEFT); // str_pad(counter,numberlentth,addNumber,whereToAdd)
echo $invID; // 011
?>
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = ""
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
echo "# CSS-workshop" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/asathoor/CSS-workshop.git
git push -u origin master
@asathoor
asathoor / gist:2a0b5bf6c6ef5ce80fd9
Created December 8, 2015 15:30
PHP mail() on one.com (from their online chat help forum)
<?php
$to = 'mail@domain.com';
$subject = 'subject';
$message = 'hello';
$headers = 'From: mail@domain.com' . "\r\n" .
'Reply-To: mail@domain.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
'Date: ' . date('r', $_SERVER['REQUEST_TIME']);