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
var http = require('http'); | |
var httpProxy = require('http-proxy'); | |
exports.createServer = function(host, proxyPort, httpPort) { | |
proxyPort = proxyPort || 8000; | |
httpPort = httpPort || 9000; | |
host = host || 'localhost'; | |
// Erstellt den Proxy-Server | |
httpProxy.createServer(httpPort, host).listen(proxyPort); |
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
(function() { | |
var root = this; | |
var giveBackOldPromise = Promise; | |
var isNode = typeof process === 'object' || window === undefined; | |
var asap = function(handler) { | |
if(isNode) { | |
process.nextTick(handler); | |
} else { |
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
(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() { }; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Index of <?= $_SERVER['SERVER_NAME'] ?></title> | |
<style type="text/css"> | |
html, body { margin: 0; padding: 0; } | |
body { font-family: 'Helvetica Neue', Arial, sans-serif; padding: 20px; } | |
a { text-decoration: none; color: #4BB7DB; } | |
a:hover { text-decoration: underline; } |
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
var out = function(val) { console.log(val); }; | |
var User = Type.create({ | |
properties: { | |
name: String, | |
id: { | |
type: Number, | |
enumerable: false | |
}, | |
class: { |
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 | |
if [ ! -d "./data" ]; then | |
mkdir -f data | |
fi | |
C:\mongodb\bin\mongod.exe --dbpath ./data/ |
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 | |
echo "Installing Express ..." | |
npm install -g express-generator | |
read -p "Choose the name for your app: " appName | |
if [[ -z "$appName" ]]; then | |
echo "Installation failed: no name supplied!" | |
exit 1 | |
fi |
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" |
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 | |
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 |