This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cookie.set('name', 'mmustermann', 2); | |
cookie.get('name'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="/racks/elements/racks.html"> | |
<racks-element name="my-tag"> | |
<style> | |
:host { | |
display: block; | |
} | |
</style> | |
<template> | |
<content></content> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Download latest toolbelt from their website | |
# https://devcenter.heroku.com/toolbelt-downloads/ | |
heroku login | |
# E-Mail: .... | |
# Password: .... | |
echo -n "Enter your GitHub Repo URL: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum install -y openssh-clients man git vim wget curl ntp | |
chkconfig ntpd on && chkconfig sshd on | |
chkconfig iptables off && chkconfig ip6tables off | |
sed -i -e 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config | |
sed -i 's/^\(Defaults.*requiretty\)/#\1/' /etc/sudoers | |
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | |
mkdir /home/vagrant/.ssh && chmod 700 /home/vagrant/.ssh | |
curl https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub >> /home/vagrant/.ssh/authorized_keys | |
chmod 600 /home/vagrant/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
class MyFrame extends JFrame { | |
private JFrame reference = this; | |
JButton myButton = new JButton(); | |
myButton.setText("Exit Applcation ..."); | |
/* Add listener for the button to close */ | |
myButton.addActionListener(new ActionListener() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo rm -rf /usr/local/lib/node_modules | |
mkdir "${HOME}/.npm-packages" | |
export PATH="$HOME/.node/bin:$PATH" |