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
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']);
@asathoor
asathoor / charset.php
Created December 22, 2015 08:19
Danske tegn mysqli
<?php
/* danske tegn */
$mysqli = new mysqli("HOST", "USER", "PASSWORD","DATABASE");
$mysqli->query("Set names 'utf8'") or die("Kunne ikke sætte danske tegn");
// ... etc ...
?>
@asathoor
asathoor / foundation4-topbar-menu.php
Created February 2, 2016 20:19 — forked from awshout/foundation4-topbar-menu.php
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
@asathoor
asathoor / wp_navwalker.php
Created May 26, 2016 21:41
Ye wp_navwalker secret
They do not tell you this:
<script>
$( document ).ready(function() {
// MENU
// wp_navwalker.php does not tell this:
$(".dropdown-toggle").click(function(){
$(".dropdown-menu").toggle(); // yes, it is that simple ...
@asathoor
asathoor / gulp_pandoc_pdf_exclude_unwanted
Created June 19, 2016 22:04
Gulping .md to .pdf and exclude an unwanted dir
/* Wiseflow: .markdown comments to .pdf */
var gulp = require('gulp');
/* the gulp-pandoc-pdf module */
var pdf = require('gulp-pandoc-pdf');
/* Select .md, !**.. = 'not Unwanted/' */
var sti = ['src/**/*.md','!**/Unwanted/**'];
// piping .pdf to build/pdf
@asathoor
asathoor / cv.php
Created November 4, 2016 07:40
PHP Array Sample
<?php
/* ***********************
Every time you have a list
an array can help you.
Let PHP loop out your
HTML markup.
*********************** */
include_once "head.php";

Pandoc eBook Create

I have used this bash script as an eBook (*.epub) compiler. The script depends on:

  • pandoc
  • cowsay

And a eBook reader.

Sources

<?php
/*
Plugin Name: PETJ_OGM
Plugin URI: https://github.com/asathoor/ogm
Description: OGP developed by Facebook ads a tile to a SoMe link. The plugin was developed for the research WordPress project.
Version: 1.0
Author: Per Thykjaer Jensen
Author URI: https://github.com/asathoor/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>