Skip to content

Instantly share code, notes, and snippets.

@CodeBrauer
CodeBrauer / paybackhelper.user.js
Last active August 2, 2023 12:59 — forked from nakami/paybackhelper.js
Turbocharge your savings! Activate all Payback coupons instantly with just one click.
// ==UserScript==
// @name Activate All Payback Coupons
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Turbocharge your savings! Activate all Payback coupons instantly with just one click.
// @author nakami, CodeBrauer
// @copyright 2022 nakami
// @license GNU General Public License v2.0
// @icon https://www.google.com/s2/favicons?sz=64&domain=payback.de
// @match https://www.payback.de/coupons*
@CodeBrauer
CodeBrauer / ajax.js
Last active September 4, 2020 07:16 — forked from jasonhinkle/ajax.js
jQuery AJAX Snippet
$.ajax({
url: 'api/url',
method: 'POST',
data: {var:'val'},
contentType: "application/json; charset=utf-8",
dataType: 'json'
}).done(function(data, textStatus, jqXHR) {
console.log('done');
}).fail(function(jqXHR, textStatus, errorThrown) {
if (jqXHR.responseJSON) {
@CodeBrauer
CodeBrauer / fix_umlaute.php
Last active January 31, 2024 07:48 — forked from pepebe/gist:4554926
SQL: Repair German "Umlaute" inside a MySQL Database. (mysqli version / PHP7 supported)
<?php
/**
* Alle kaputten Umlaute reparieren bei Umstellung von ISO->UTF8
* Source: http://xhtmlforum.de/66480-kleines-skript-alle-umlaute-der-datenbank.html
*
* @project -
* @author Boris Bojic <bojic@devshack.biz>
* @copyright Copyright (c) 2011, Boris Bojic (DevShack)
* @version Fri, 23 Dec 2011 13:47:11 +0100
* @updated -
@CodeBrauer
CodeBrauer / Default (OSX).sublime-keymap
Created June 21, 2017 07:41 — forked from mjleino/Default (OSX).sublime-keymap
Banish non-breaking spaces from Sublime Text
// Preferencs -> Key Bindings – User
[
{
"keys": ["alt+space"],
"command": "insert",
"args": { "characters": " "}
}
]
@CodeBrauer
CodeBrauer / gist:b938983729c024ad6ab81b1ee7e2f1ed
Last active November 16, 2016 15:32 — forked from mikejolley/gist:1604009
WooCommerce - Add a special field to the checkout, order emails and user/order meta
<?php
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
@CodeBrauer
CodeBrauer / index.html
Created November 9, 2016 11:19 — forked from anonymous/index.html
Style visited links with localStorage
<div class="wrap">
<h1>Style visited links with localStorage</h1>
<h2>Why?</h2>
<p>
Since browsers allow only very basic CSS on <code>:visited</code> I created this way to check a user has clicked a link. If he clicks on any link, that has the class <code>.trackVisit</code> the complete href is saved in an array in localStorage.
On each page visit and click on a link the script adds the class <code>.visited</code> so we can style it however we want.
</p>
<h2>Demo Links: Repo services</h2>
<p>
The links have <code>e.preventDefault();</code> - so you can click them hassle free ;)
@CodeBrauer
CodeBrauer / rustServerScript.sh
Created January 8, 2016 00:18 — forked from Rhagnur/rustServerScript.sh
Angepasstes Skript um Rust Server auf Linux zum laufen zu bekommen
#!/bin/bash
#command to manually start if you want to close this script (do it in screen)
#xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine RustDedicated.exe -batchmode +rcon.ip 0.0.0.0 +rcon.port "48000" +rcon.password killer +server.hostname "-LINUX RUST-US-Pro Admins-NO WIPE-NEWBS WELCOM-" +server.port "28015" +server.identity "nfo_rust_server1" +server.maxplayers "2000"
#####################################################################################
# Linux script for Rust server installing. #
# Can also be used to update Rust server and steamcmd. #
# Starts a rust server at the end. #
# #
# If you use a sudoers file please execute this command first to get root access: #
# sudo -s #
@CodeBrauer
CodeBrauer / osx-for-hackers.sh
Last active August 29, 2015 14:26 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'