Skip to content

Instantly share code, notes, and snippets.

View janbiasi's full-sized avatar
🌐
Just building

Jan R. Biasi janbiasi

🌐
Just building
View GitHub Profile
cookie.set('name', 'mmustermann', 2);
cookie.get('name');
@janbiasi
janbiasi / snippet1.html
Last active August 29, 2015 14:09
Triebwerk snippets for a simple HTML and CSS website
<title>Stellwerk. Informatik. HTML. Beispiel. Namics</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script src="js/jquery.min.js"></script>
<script src="js/jquery.scrolly.min.js"></script>
<script src="js/jquery.poptrox.min.js"></script>
<script src="js/skel.min.js"></script>
<script src="js/init.js"></script>
@janbiasi
janbiasi / installer.sh
Last active August 29, 2015 14:09
A tool for Raspian Micro Computers to optimize the Software on it
#!/bin/sh
ip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
echo "\nInstalling Apache WebServer accessible with $ip ..."
sudo apt-get install apache2 -y
echo "\nInstalling PHP 5.X on $HOSTNAME ..."
sudo apt-get install php5 libapache2-mod-php5 -y
@janbiasi
janbiasi / apache.sh
Last active August 29, 2015 14:09
A tiny installer for linux including Apache, MySQL, PHP and GitLab (v5.0)
#!/bin/sh
echo "You have to be the root user to execute this script!"
echo "What is your OS?"
echo "1 OpenSuSE"
echo "2 Ubuntu"
echo "3 RedHat"
echo "4 Debian"
echo "5 Go Back"
echo "6 Quit"
@janbiasi
janbiasi / database-helper.php
Created November 11, 2014 11:54
A simple PHP helper for working JSON including a short demo
<?php
// Get content from the DB
function readDatabase($path) {
return (array)json_decode(file_get_contents($path));
}
// Save content to the DB
function saveDatabase($path, $content) {
file_put_contents($path, json_encode($content));
@janbiasi
janbiasi / base.css
Created November 3, 2014 08:21
Basic CSS for WebApps
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,700,600);
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
html,
body,
@janbiasi
janbiasi / helper.js
Last active August 29, 2015 14:07
Helper
(function(window, undefined) {
var defineSingleEventListener = function(element, event, callback) {
try {
if(element.attachEvent) {
return element.attachEvent('on' + event, callback);
} else {
return element.addEventListener(event, callback, false);
}
} catch(e) {
@janbiasi
janbiasi / ajax.js
Last active February 3, 2016 19:52
ajax
(function(window, undefined) {
var strEq = function(str1, str2) {
return str1.toLowerCase() === str2.toLowerCase();
};
var ajaxRequest = function(method, opts) {
opts = opts ? opts : {};
opts.data = opts.data || null;
opts.success = opts.success || function() { };
@janbiasi
janbiasi / export.sh
Created September 9, 2014 21:58
Export GitHub wiki as HTML files
#!/bin/bash
# for each md file in the directory
for file in *.md
do
# convert each file to html and place it in the html directory
# --gfm == use github flavoured markdown
marked -o pages/$file.html $file --gfm
done
@janbiasi
janbiasi / export.php
Created September 9, 2014 07:52
A simple Wordpress post exporter written in PHP
<?php
// Security checking
define('ABSPATH') or die ("Script kiddies!");
// Defining path and filename
$outPath = 'postbackup/';
$fileName = 'wp_posts_' . date('m-d-Y-His A e') . '.xml';
// Indlude the wordpress stuff
require(dirname(dirname(__FILE__)) . '/wp-load.php');