Skip to content

Instantly share code, notes, and snippets.

@Jan-Bart
Jan-Bart / git-tag-delete-local-and-remote.sh
Last active July 26, 2018 10:40 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# show all tags
git tag
# show only some tags
git tag -l <pattern>
git tag --sort=<type>
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
'use strict';
const async = require('async');
const gpio = require('rpi-gpio');
const BUZZER_PIN = 5;
const TIME_ON = 150;
const TIME_OFF = 900;
const BUZZ_TIME = 20;
gpio.setMode(gpio.MODE_BCM);
@Jan-Bart
Jan-Bart / serverSetup.yml
Last active October 7, 2017 12:33
This will do the basic setup after getting your hands on a new server. It will create a new user, disable the root user and install/configure ufw, fail2ban, logwatch and postfix.
# Based on: https://ryaneschinger.com/blog/securing-a-server-with-ansible/
- hosts: all
gather_facts: false
pre_tasks:
- name: install python needed for ansible modules to work
raw: sudo bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qy python-minimal)"
tasks:
@Jan-Bart
Jan-Bart / or-after-equal.php
Created June 10, 2014 13:39
Test to see if we can use fn = fn || new Function(); in PHP as well
<?php
echo "Test var1 en var2 = 'iets'";
$var1 = "";
$var2 = "iets";
$temp = $var1 || $var2;
echo " Result: ". $temp. "\n";
var_dump($temp);
// Require a bunch of shit
var express = require('express');
var app = express();
var mongoose = require('mongoose');
var fs = require('fs');
mongoose.connect('mongodb://localhost/devdocu');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function callback () {
#!/bin/bash
# File: ~/startDev.sh
function new_tab() {
TAB_NAME=$1
COMMAND=$2
osascript \
-e "tell application \"Terminal\"" \
-e "tell application \"System Events\" to keystroke \"t\" using {command down}" \
-e "do script \"printf '\\\e]1;$TAB_NAME\\\a'; $COMMAND\" in front window" \
@Jan-Bart
Jan-Bart / newLocalSite.sh
Created October 14, 2013 06:57
Create a new local site (on mac os 10.8.5 without MAMP)
#!/bin/bash
# settings
VHOSTSFILE="/private/etc/apache2/extra/httpd-vhosts.conf"
SITEPATH="/Users/USERNAME/Sites/"
# run this as root
read -p "New local site name: " SITE
#/etc/hosts
<?php
$value = "This cookie resides in an iframe";
// Set a cookie
setcookie("iframeCookie", $value);
echo '<h1>Cookie test</h1>';
// Read the cookie
echo $_COOKIE["iframeCookie"];
<iframe src="iframe.php" width="300" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
@Jan-Bart
Jan-Bart / start2dev
Created June 28, 2013 17:17
Start developing right away
#!/bin/bash
# Version 1 - 27/06/2013
# On a new computer, check if everything exists
# if not, install it
GITVERSION=$(which git)
if [[ $GITVERSION ]]
then