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
# 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 |
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
'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); |
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
# 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: |
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 | |
echo "Test var1 en var2 = 'iets'"; | |
$var1 = ""; | |
$var2 = "iets"; | |
$temp = $var1 || $var2; | |
echo " Result: ". $temp. "\n"; | |
var_dump($temp); |
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
// 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 () { |
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 | |
# 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" \ |
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 | |
# 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 |
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 | |
$value = "This cookie resides in an iframe"; | |
// Set a cookie | |
setcookie("iframeCookie", $value); | |
echo '<h1>Cookie test</h1>'; | |
// Read the cookie | |
echo $_COOKIE["iframeCookie"]; |
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
<iframe src="iframe.php" width="300" height="300"> | |
<p>Your browser does not support iframes.</p> | |
</iframe> |
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 | |
# Version 1 - 27/06/2013 | |
# On a new computer, check if everything exists | |
# if not, install it | |
GITVERSION=$(which git) | |
if [[ $GITVERSION ]] | |
then |
NewerOlder