Skip to content

Instantly share code, notes, and snippets.

Avatar
🍋

Jan R. Biasi janbiasi

🍋
View GitHub Profile
@janbiasi
janbiasi / git.sh
Last active Oct 28, 2020
Git Merge branch in master as overwrite
View git.sh
#!/bin/sh
TARGET="master"
BRANCH="seotweaks"
git push origin $TARGET && git stash
# Overwrite $TARGET with $BRANCH
git checkout $BRANCH
git merge -s ours $TARGET
View mongo-connect.sh
#!/bin/bash
if [ ! -d "./data" ]; then
mkdir -f data
fi
C:\mongodb\bin\mongod.exe --dbpath ./data/
View install-express.sh
#!/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
View node_setup.sh
#!/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 Aug 29, 2015
Simple eventhandling for frames and so on in java
View events.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() {
View vagrant-prepare.sh
#!/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 Mar 24, 2015
Single-script heroku application creation for the shell
View heroku.sh
#!/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: "
View racks.component.html
<link rel="import" href="/racks/elements/racks.html">
<racks-element name="my-tag">
<style>
:host {
display: block;
}
</style>
<template>
<content></content>
</template>
View app.js
cookie.set('name', 'mmustermann', 2);
cookie.get('name');
@janbiasi
janbiasi / snippet1.html
Last active Aug 29, 2015
Triebwerk snippets for a simple HTML and CSS website
View snippet1.html
<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>