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
@janbiasi
janbiasi / index.php
Created January 13, 2016 08:49
Tired of the default XAMPP/MAMP Index? Try this one and get a beautiful directory listing in your server root!
<!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; }
@janbiasi
janbiasi / example-properties.js
Last active January 6, 2016 10:49
Node Type let you easily work with types and its core possibilities such as enumerability, writability and readonly settings. Properties can be declared with a specific type and a livetime validator.
var out = function(val) { console.log(val); };
var User = Type.create({
properties: {
name: String,
id: {
type: Number,
enumerable: false
},
class: {
@janbiasi
janbiasi / git.sh
Last active October 28, 2020 09:54
Git Merge branch in master as overwrite
#!/bin/sh
TARGET="master"
BRANCH="seotweaks"
git push origin $TARGET && git stash
# Overwrite $TARGET with $BRANCH
git checkout $BRANCH
git merge -s ours $TARGET
#!/bin/bash
if [ ! -d "./data" ]; then
mkdir -f data
fi
C:\mongodb\bin\mongod.exe --dbpath ./data/
#!/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
#!/bin/bash
sudo rm -rf /usr/local/lib/node_modules
mkdir "${HOME}/.npm-packages"
export PATH="$HOME/.node/bin:$PATH"
@janbiasi
janbiasi / events.java
Last active August 29, 2015 14:22
Simple eventhandling for frames and so on in java
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() {
#!/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
@janbiasi
janbiasi / heroku.sh
Created March 24, 2015 08:26
Single-script heroku application creation for the shell
#!/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: "
<link rel="import" href="/racks/elements/racks.html">
<racks-element name="my-tag">
<style>
:host {
display: block;
}
</style>
<template>
<content></content>
</template>